liveBook · Manning

Interrupt

As explained in Latency

A hardware interrupt is an interrupt signal generated by hardware to request operating-system processing.

A hardware interrupt is a signal from a device that interrupts the CPU’s current work and invokes an operating-system handler. Devices use interrupts to request attention when events occur, such as a network packet arriving, an I/O operation completing, or a timer firing. section 7.5.2 section 2.3.4

The operating system may handle the hardware interrupt quickly and defer further work to kernel processing, sometimes called a software interrupt. In Linux network processing, software interrupt handling performs protocol processing before the application processes the message. section 7.5.2 section 3.3.1

Figure 3.3 Packets traversing the network stack
Figure 3.4: Packets traversing the network stack.

Trace a packet from the NIC receive queue through protocol processing to the application. section 3.3.1

Interrupt handling can delay an application at unpredictable times. The CPU stops application code, saves its state, and enters the handler; this interrupt latency can take several microseconds. Further processing can also interfere with application work, and high interrupt rates can cause latency spikes. section 2.3.4 section 7.5.2

Low-latency systems can manage this interference in several ways:

  • Poll for events instead of waiting for notification. Linux network drivers can switch between polling and interrupt-driven operation, but repeated polling can do more work when events are infrequent. section 3.3.1 section 7.5.2
  • Consider CPU placement: isolate interrupt processing on dedicated CPUs, or colocate it with application threads. Protocol processing and the application may otherwise run on different CPUs. section 3.3.1
  • Consider interrupt affinity and interrupt coalescing as techniques for mitigating interrupt overhead. section 2.3.4

How Latency covers it

How deep it goes
Explains handlers, deferred processing, and polling trade-offs without detailing interrupt internals.
Examples
Uses packet arrivals, completed I/O, and timer events to illustrate interrupt triggers.
What you can do after
Evaluate interrupt-related latency and compare polling with interrupt-driven processing.
How it connects
Connects interrupts to device drivers, polling, network protocol processing, interrupt affinity, and interrupt coalescing.

Also explained in

Compare how 4 books explain interrupt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.