silicon atlasTHE HARDWARE REFERENCE
العربية
Reference/The whole system
Systems & I/O

Interrupts, timers & polling

Notify the CPU about events, or repeatedly check for them.

A device can finish its work while the CPU is busy doing something else.
Event source

Device or timer event.

LIVE EXPERIMENT

Follow an instruction

Runs on your device
12345678910
I1
F
D
E
M
W
I2
F
D
E
M
W
I3
F
D
E
M
W
I4
F
D
E
M
W
I5
F
D
E
M
W
I6
F
D
E
M
W
F · FetchD · DecodeE · ExecuteM · MemoryW · Writeback
Instructions6
Total cycles10
Visible cycle1

Overlap improves throughput. Dependencies introduce bubbles unless the implementation can forward or do independent work.

What this model includes

Five-stage, single-issue teaching model. Dependent mode inserts two idle issue cycles per instruction; real forwarding and hazards vary.

FOLLOW THE MECHANISM

What happens inside

1

Deliver an event

An interrupt controller routes events to a processor. The CPU saves required state and runs a handler under architectural rules. PCIe devices often use message-signaled interrupts such as MSI/MSI-X. Timers trigger scheduling and timekeeping events. Exceptions arise from instruction execution and differ from asynchronous device interrupts.

2

Choose notification or polling

Interrupts avoid constant checking at low event rates. Frequent events can create overhead, so devices may batch notifications or an OS may poll temporarily. Polling can reduce wake-up latency at the cost of CPU time and energy. Deferred work keeps handlers short when the OS requires it.

PUT IT TO WORK

What this means for your code

Low-level engineer

Know interrupt context, masking, acknowledgment, and reentrancy rules. Do not sleep where the kernel’s execution context forbids it.

Software developer

Latency can include wake-up and queueing, not just device time. Busy polling is a deliberate energy and CPU tradeoff.

GO TO THE SOURCE

Read the actual specifications

These references supply the underlying contracts and implementation details. The diagrams here are simplified teaching models.

Linux · PCI driversLinux kernel documentation
Linux · MSI driver guideLinux kernel documentation

Keep following the connection

Understood the idea? Keep a note of your progress.