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
  • Part 6: Concurrency and Performance17
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
    • Shared Media and Topologies
    • Arbitration Policies
    • Fairness and Starvation
    • Priority Inversion
    • Arbitration Granularity
    • Distributed Arbitration
    • Quality of Service
    • Virtual Channels
    • Routing
    • Multicast and Broadcast
    • Protocols Compared: Sharing and Arbitration
    • Drills: Sharing and Arbitration
  • 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 8: Sharing and Arbitration
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 8: Sharing and Arbitration
  4. Priority Inversion

Part 8 · Sharing and Arbitration · Senior (S)

Priority Inversion

Priority inversion: a high-priority requester waits for a resource held by a low-priority one, while medium-priority traffic keeps the holder from finishing. How it appears in hardware, and the fixes: inheritance, bounded holds, no locks.

On this page

    Note

    Level: Senior (S) · Answers: Who gets the wire?

    Before this: Fairness and Starvation, Atomics

    In 1997, a spacecraft on Mars kept resetting itself. A high-priority task needed a shared resource held by a low-priority task, and the low-priority task could not finish because medium-priority tasks kept running ahead of it. The high-priority task stopped making progress until a watchdog reset the whole system. The same pattern appears in hardware, wherever a shared resource can be held while priorities decide who runs.

    How can a high-priority requester end up waiting behind a low-priority one, and how is it prevented?

    The obvious answer, and why it breaks

    The obvious defence for urgent traffic is high priority: give it precedence at every arbiter and it can never be held up for long. That works as long as the urgent requester only competes for arbitration. As soon as it needs a resource that someone else already holds (a locked bus, a semaphore, a buffer slot, an open burst), priority at the arbiter no longer helps. It must wait for the holder, and the holder runs at its own, low priority.

    The idea: three requesters, one held resource

    The high-priority requester waits on the low-priority holder, which keeps losing arbitration to medium-priority traffic: high now waits for medium.

    The effect is that high priority waits for medium priority, the inversion. The wait is unbounded if medium traffic can keep winning.

    Where it appears in hardware

    Held resource

    Inversion

    A locked bus sequence

    A low-priority master holds the bus for a read-modify-write; the processor's urgent accesses wait for the whole sequence

    A shared buffer or tracker slot

    Low-priority requests fill a target's queue; a high-priority request must wait for them to drain, at their priority

    An in-progress burst

    A long low-priority burst holds a link; urgent traffic waits for it to finish (lesson 8.5)

    A software lock in shared memory

    The classic case, as in the opening story

    The fixes

    Fix

    How it works

    Cost

    Priority inheritance

    While a high-priority requester waits on a holder, the holder runs at the high priority

    Tracking who waits on whom

    Priority escalation (QoS promotion)

    In a fabric, raise the priority of transactions ahead of urgent ones in a queue, so the queue drains faster

    Logic to detect the urgent waiter

    Bounded holds

    Limit lock length, burst length and queue share per requester, so any hold ends in bounded time

    Some throughput

    No holds

    Replace locks with exclusive accesses or far atomics, which never hold the path (lesson 5.13)

    Retries, or atomic logic at the target

    Reserved resources

    Keep queue slots or buffers that only urgent traffic may use

    Some capacity idle

    How real systems chose

    • AXI4 removed locked transfers, so a requester cannot hold the interconnect for a read-modify-write; exclusive accesses detect interference instead.

    • Real-time operating systems provide mutexes with priority inheritance; the opening spacecraft was fixed by enabling it on the mutex involved.

    • QoS-aware interconnects can promote the priority of transactions that block urgent ones, and reserve queue slots for high-priority classes (lesson 8.7).

    What breaks

    The Mars Pathfinder lander (1997): a low-priority meteorological task held a mutex that the high-priority bus-management task needed, while medium-priority communications tasks kept running. The bus task missed its deadline, a watchdog noticed, and the system reset, repeatedly. Priority inheritance had been switched off on that mutex. Engineers reproduced the fault on a ground replica, found it in the trace, and enabled inheritance with an update.

    Why this matters

    Senior lens. Wherever urgent traffic can wait for a resource someone else holds, priority at the arbiter is not enough. List every held resource (locks, bursts, queue slots, trackers) on urgent paths and give each one a bound, inheritance or escalation, or a reservation. The quickest win in hardware is to eliminate holds: no locked transfers, bounded bursts, and reserved slots for urgent classes.

    Interview

    Asked: "How can a locked transfer starve the CPU?"

    Weak answer: Locks are slow.

    Strong answer: A low-priority master starts a locked read-modify-write and holds the bus or target. The CPU's high-priority accesses now wait for the lock, not for arbitration, so their priority doesn't help. If medium-priority traffic keeps the lock holder from finishing, or the lock is long, the CPU waits unboundedly: priority inversion. Fixes are to avoid locks (exclusives or far atomics, which is why AXI4 dropped locked transfers), bound how long a hold can last, or raise the holder's priority while someone urgent waits.

    Follow-ups: (1) What is priority inheritance? (2) How does an interconnect implement QoS promotion?

    Check yourself Why doesn't giving the urgent requester the highest arbitration priority prevent inversion?

    Because it is waiting for a resource that is already held, not for arbitration; the holder must finish first, and it runs at its own lower priority.

    Check yourself How do exclusive accesses avoid inversion that locked transfers cause?

    They never hold the path or target: an exclusive pair either succeeds or fails and retries, so nobody waits behind a holder.

    Key takeaways

    • Priority inversion: an urgent requester waits on a low-priority holder, which waits behind medium traffic.

    • It appears in hardware wherever a resource can be held: locks, bursts, queue slots, trackers.

    • Fix with inheritance or escalation, bounded holds, reserved resources, or by removing holds altogether.

    Keep going

    Next: Lesson 8.5, Arbitration Granularity. Per beat, per burst or per locked sequence: how often the arbiter may change its mind.

    Related topics

    • Part 8 overview: Sharing and Arbitration

    Previous

    120 / 234

    Next: Arbitration Granularity

    Up next

    Up nextArbitration Granularity

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Shared Media and Topologies
    • Arbitration Policies
    • Distributed Arbitration