Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • How to Read the Diagrams
  • Part 0: What Is a Protocol?10
  • Part 1: Timing and Clocking11
  • Part 2: Encoding and Framing12
  • Part 3: Handshakes13
  • Part 4: Flow Control17
  • Part 5: Transactions19
    • Reads and Writes Are Not Symmetric
    • The Request/Response Model
    • Address Maps and Decoding
    • Register Semantics
    • Combined and Split Transactions
    • Independent Channels
    • Posted and Non-Posted Writes
    • Bursts
    • Alignment, Strobes and Narrow Transfers
    • Boundary Rules
    • Width and Endianness Conversion
    • Transaction Attributes
    • Atomics
    • Sideband or In-Band
    • Interrupts and Notification
    • Descriptors, Rings and Doorbells
    • Bridges and Protocol Conversion
    • Protocols Compared: Transactions
    • Drills: Transactions
  • Part 6: Concurrency and Performance17
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
  • Part 9: Deadlock and Liveness13
  • Part 10: Reliability and Recovery20
  • Part 11: Bring-Up and Link Management10
  • Part 12: Power8
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 5: Transactions
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 5: Transactions
  4. Interrupts and Notification

Part 5 · Transactions · Working (W)

Interrupts and Notification

How a device tells software that something happened: level, edge and message-signalled interrupts, polling, and interrupt coalescing, with the numbers that decide between them for a fast device.

On this page

    Note

    Level: Working (W) · Answers: What exactly is being asked?

    Before this: Sideband or In-Band

    A network card receives packets at full rate and raises an interrupt for each one. The processor spends all its time entering and leaving the interrupt handler, and packets start being dropped, not because the processor is slow at handling packets, but because it is too busy being interrupted to handle any. Interrupting more did not deliver more.

    How should a device tell software that work is ready, and how does the answer change with rate?

    The obvious answer, and why it breaks

    The obvious answer is an interrupt per event: the device signals, software runs a handler, done. At low event rates it is ideal: no wasted work while idle, prompt response. But each interrupt has a fixed cost (saving state, running the handler, returning), and at high event rates that fixed cost, multiplied by the rate, can exceed the time available. Notification must adapt to the rate.

    The idea: kinds of interrupt, and when not to interrupt

    Mechanism

    How it works

    Strength

    Weakness

    Level-triggered wire

    The wire stays asserted while the device needs service; software clears the cause

    Never lost: still asserted if missed; easy to share

    Shared lines need every handler polled; races data (lesson 5.14)

    Edge-triggered wire

    A transition signals an event

    No need to clear a level

    An edge missed while masked is lost

    Message-signalled

    The device writes a value to a programmed address; each value can mean a different event

    Many distinct vectors, no wires, ordered behind data

    Needs a data path and an interrupt controller that decodes writes

    Polling

    Software checks a status (or a ring in memory) regularly

    No interrupt overhead; best at high rates

    Wastes processor time when idle; adds latency up to the poll interval

    Coalescing

    The device interrupts once per N events or per T microseconds

    Bounds interrupt rate

    Adds up to T of latency to the first event

    A message-signalled interrupt is an ordinary write, sent after the data, so it arrives after the data has landed.

    Worked numbers: a 100 Gb/s network card

    Minimum-size Ethernet frames, 64 bytes, each with 20 bytes of fixed overhead on the wire (preamble, start delimiter and inter-frame gap).

    Diagram
    Bytes per frame on the wire:   64 + 20                = 84 bytes = 672 bits
    Frames per second:             100e9 / 672            = 148.8 million
    Time per frame:                1 / 148.8e6            = 6.7 ns
    An interrupt costing 1 us (illustrative) per frame needs 148.8 seconds of processor time per second: impossible.
    Coalescing 64 frames per interrupt:  2.3 million interrupts/s = 2.3 s of processor time per second at 1 us each: still too many for one core
    Polling the receive ring while busy: no interrupts at all; interrupt again only when the ring goes idle

    That is why fast devices combine mechanisms: interrupt when idle (prompt response, no wasted polling), switch to polling while busy (no per-event cost), and coalesce in between. Each event is written into a ring in memory (lesson 5.16), so notification only says "look at the ring", not "here is one event".

    How real systems chose

    System

    Choice

    PCI Express

    Message-signalled interrupts: MSI with up to 32 vectors per function, MSI-X with up to 2048; each is a posted memory write. Legacy INTx is emulated with messages.

    Linux network drivers

    NAPI: take an interrupt, then disable it and poll the device's ring until it is empty, then re-enable the interrupt.

    On-chip peripherals on AXI or APB

    Wired interrupts, usually level-triggered, into an interrupt controller.

    What breaks

    • Interrupt livelock: the opening network card. The processor is saturated by interrupt overhead and does no useful work.

    • Lost edge: an edge-triggered interrupt that fires while masked (illustrative) is never seen; the device waits for service that never comes. Level-triggered interrupts or a status register that records events avoid it.

    • Stale data: a wired interrupt that overtakes DMA writes (lesson 5.14). A message-signalled interrupt behind the data avoids it.

    Why this matters

    Senior lens. Size notification from the event rate and the per-interrupt cost. Ask for the worst-case event rate, the interrupt cost on the target processor, and the latency budget; then decide where to interrupt, coalesce or poll. Put events in a ring in memory so notification is decoupled from event count, and use message-signalled interrupts so notification is ordered behind the data.

    Interview

    Asked: "Polling or interrupts for a 100 Gb/s NIC?"

    Weak answer: Interrupts, because polling wastes CPU.

    Strong answer: Both, depending on load. At line rate with small packets that's about 149 million packets per second, about 6.7 ns each, so an interrupt per packet is impossible. The NIC writes descriptors into a ring and coalesces interrupts; the driver takes one interrupt, then polls the ring while it's busy and re-enables the interrupt when it drains, which is what Linux NAPI does. Interrupts give low latency when idle; polling gives throughput when busy. MSI-X lets each queue have its own vector.

    Follow-ups: (1) What does coalescing cost? (2) Why is a lost edge interrupt dangerous?

    Check yourself A device generates 2 million events per second and an interrupt costs 2 µs. What fraction of one core goes to interrupt overhead with one interrupt per event?

    2e6 × 2 µs = 4 seconds per second: four cores' worth, so it cannot work. Coalescing 32 events per interrupt brings it to 12.5% of one core.

    Check yourself Why is a level-triggered interrupt harder to lose than an edge-triggered one?

    The level stays asserted until software clears the cause, so if it is missed while masked, it is still there when unmasked; an edge is gone once it has passed.

    Key takeaways

    • Level, edge and message-signalled interrupts trade reliability, sharing and ordering; MSI is a posted write that follows the data.

    • Every interrupt has a fixed cost; at high event rates coalesce or poll.

    • Fast devices put events in a memory ring and switch between interrupts when idle and polling when busy.

    Keep going

    Next: Lesson 5.16, Descriptors, Rings and Doorbells. The producer/consumer ring that drives DMA engines and network cards.

    Related topics

    • Part 5 overview: Transactions

    Previous

    82 / 234

    Next: Descriptors, Rings and Doorbells

    Up next

    Up nextDescriptors, Rings and Doorbells

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Reads and Writes Are Not Symmetric
    • The Request/Response Model
    • Address Maps and Decoding