Interrupt request

Also known as: IRQ

On this page 7

An interrupt request (IRQ) is a signal from a hardware device asking the processor to suspend its current instruction stream and run code that services that device. In operating systems, the interrupt request is the basic mechanism by which network adapters, storage controllers, timers and keyboards announce that data is ready or an operation has finished, so the kernel does not have to check each device continuously.

Within the area of drivers & devices, the term IRQ also names the numbered interrupt line or vector assigned to a device. When an IRQ arrives, the processor saves its state, looks up the handler in the interrupt vector table and transfers control to the driver’s interrupt service routine.

How an interrupt request reaches the processor

An interrupt request travels from the device through an interrupt controller to a processor core, which then runs a registered handler. The controller collects many device inputs, applies priority and masking rules, and presents a single vector number to the CPU at the next instruction boundary.

The sequence below summarizes what happens on a typical x86-64 or ARM system when a device raises an IRQ. Exact details differ by architecture, but the order of steps is broadly the same.

StageWhat happensComponent involved
AssertionDevice drives a line or writes a messageDevice hardware
ArbitrationController checks mask and priorityAPIC, GIC or PIC
AcceptanceCore finishes the current instruction and saves contextProcessor core
DispatchVector number selects a handler entryInterrupt vector table
ServiceDriver acknowledges the device and queues workInterrupt service routine
CompletionEnd-of-interrupt is signaled and context restoredController and kernel
Stages of interrupt delivery

The kernel keeps the service routine as short as possible. Linux splits the work into a top half, which runs with the interrupt line masked, and a bottom half such as a softirq, tasklet or threaded handler. Windows uses the same idea with an ISR followed by a deferred procedure call (DPC). This split keeps other interrupts from waiting behind slow processing.

Types of IRQ signaling

IRQs differ mainly in how the device signals and whether the signal can be shared. Older buses used physical pins, while modern PCI Express devices send interrupts as memory writes.

Signaling formHow it is triggeredSharing behaviorTypical use
Edge-triggeredTransition of the line from low to highPoor; edges can be lostLegacy ISA devices
Level-triggeredLine held active until servicedGood; handlers check their devicePCI INTx pins
Message signaled (MSI)Write to a special memory addressNot needed; unique vectorsPCI Express devices
MSI-XPer-queue address and data pairsNot needed; up to 2,048 vectorsNVMe, multiqueue NICs
Inter-processor interruptOne core signals anotherNot applicableTLB shootdown, scheduling
Main forms of interrupt signaling

Message signaled interrupts removed the main weakness of pin-based IRQs. Because each queue of a network or NVMe controller can have its own vector, the operating system can steer interrupts to specific cores and keep cache locality, which matters at millions of packets or I/O operations per second.

From fixed IRQ numbers to dynamic vectors

Early PCs had only 16 IRQ lines, provided by two cascaded Intel 8259 programmable interrupt controllers, and many numbers were fixed by convention. Users once set jumpers by hand, and IRQ conflicts between sound cards, modems and network cards were a common cause of devices that failed to work.

IRQConventional deviceStatus today
IRQ 0System timerReplaced by local APIC and HPET timers
IRQ 1PS/2 keyboard controllerOften emulated for USB keyboards
IRQ 2Cascade to the second controllerRemapped to IRQ 9
IRQ 8Real-time clockStill present on many chipsets
IRQ 14 and 15Primary and secondary IDEUnused on AHCI and NVMe systems
Classic PC IRQ assignments

Plug and play firmware, ACPI tables and the Advanced Programmable Interrupt Controller (APIC) ended manual assignment. The I/O APIC provides 24 or more inputs per controller, and the local APIC in each core accepts up to 224 usable vectors. On ARM systems the Generic Interrupt Controller (GIC) plays the same role, and the device tree or ACPI describes which interrupt each peripheral uses.

An IRQ is one of several ways a device and the processor coordinate. The key distinction is who initiates the exchange and who moves the data.

MechanismInitiatorMain purposeRelation to IRQ
Interrupt requestDeviceSignal that attention is neededThe event itself
PollingProcessorRepeatedly read device statusAlternative to IRQs
Direct memory accessDeviceMove data without the CPUUsually ends with an IRQ
ExceptionProcessorReport a fault in running codeShares the vector table
Software interruptProgramRequest a kernel serviceSame entry path, different source
Interrupt requests and neighboring concepts

High-throughput drivers often combine interrupts and polling. Linux NAPI disables a network IRQ once traffic arrives and polls the receive ring until it is empty, then re-enables the interrupt. Storage stacks apply similar interrupt coalescing, where hardware waits for several completions or a short timer before raising one IRQ.

Configuring and troubleshooting IRQs

Administrators rarely assign IRQ numbers today, but they still tune interrupt affinity, coalescing and latency. On Linux, /proc/interrupts shows per-core counts and /proc/irq/N/smp_affinity controls which cores may handle a vector; the irqbalance daemon adjusts this automatically. On Windows, Device Manager lists resources by connection and tools such as LatencyMon measure ISR and DPC execution times.

  • Interrupt storms occur when a device keeps asserting a level-triggered line that no handler clears, which can consume an entire core.
  • Long ISR or DPC times raise interrupt latency and cause audio dropouts or missed real-time deadlines.
  • Uneven affinity concentrates all IRQs on core 0 and limits network throughput on multicore servers.
  • Firmware bugs in ACPI routing tables can assign the wrong line, leaving a device silent until a kernel parameter or update corrects it.

In virtual machines, IRQs are emulated or passed through. Posted interrupts and an IOMMU with interrupt remapping let a guest receive device interrupts directly, which reduces exits to the hypervisor and protects the host from malicious interrupt messages.

A plain-language summary

An interrupt request is a device tapping the processor on the shoulder. The computer does not ask the keyboard, the disk and the network card over and over whether they have news. Instead, each device raises its hand only when it needs attention.

When that happens, the processor briefly pauses its work. It lets the right driver handle the device, and then it continues. This saves a great deal of effort. It is also the reason a computer can react quickly to a key press while still running other programs.

An example from practice

A systems engineer runs a Linux server with a 25 Gb/s network adapter that handles web traffic. Monitoring shows that one core sits at 100 percent while the others are mostly idle, and request latency spikes at peak hours. Reading /proc/interrupts reveals that all receive-queue IRQs land on core 0.

The adapter supports MSI-X with 16 queues, so the engineer enables receive-side scaling, spreads the queue vectors across 16 cores through their affinity masks, and raises the coalescing delay from 0 to about 50 microseconds. The interrupt rate per core drops sharply, cache locality improves, and throughput rises while tail latency falls to within the service target.