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
  • 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
    • Why Coherence
    • Invalidate or Update
    • MSI, MESI and MOESI
    • Snooping or Directory
    • Ownership and Forwarding
    • Coherence and Consistency
    • I/O Coherence and Cache Maintenance
    • Protocols Compared: Shared State and Coherence
    • Drills: Shared State and Coherence
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 13: Shared State and Coherence
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 13: Shared State and Coherence
  4. Snooping or Directory

Part 13 · Shared State and Coherence · Senior (S)

Snooping or Directory

A coherence protocol must find the other copies of a line. Snooping broadcasts every request to every cache; a directory keeps a record of who holds what and messages only them. What each costs, and why large systems move to directories.

On this page

    Note

    Level: Senior (S) · Answers: What if there are several copies of one value?

    Before this: MSI, MESI and MOESI

    On a 4-core chip, every cache miss is shown to every other cache: three lookups per miss, cheap and fast. The same design on 64 cores shows every miss to 63 caches. Most of them have no copy and answer "not here". Snoop traffic grows with the number of cores times the miss rate, and at some point the caches spend more time answering questions than serving their own core.

    How does a coherence protocol find the other copies of a line, and how does that scale?

    The obvious answer, and why it breaks

    The obvious answer is to ask everyone: broadcast the request, and whoever has a copy acts. That is snooping, and on a small system with a shared bus it is ideal: the bus orders all requests, and every cache sees them in the same order. But every request costs a lookup in every cache and a message on every link, needed or not. Bandwidth and lookup power grow with the number of caches, while most caches, for most lines, have nothing to say.

    The idea: broadcast, or keep a record

    Snooping

    Directory

    Finding copies

    Broadcast every request to all caches

    Look up the line's entry at its home node: which caches hold it, in what state

    Messages per request

    One to every cache

    Only to the caches that hold it (often none)

    Ordering

    A shared bus or ordered broadcast network orders requests

    The home node orders requests for its lines

    Latency

    Direct: requester to all, owner replies

    Indirect: requester to home, home to owner, owner to requester (lesson 13.5)

    Storage

    None beyond the caches

    A directory entry per tracked line (sharer bits or pointers)

    Scales to

    Small core counts

    Many cores

    The directory knows which caches hold line X, so only that cache is asked to invalidate; the other caches in the system never see the request.

    Between the two: snoop filters

    • A snoop filter records which lines are present in which caches (or at least which are certainly absent), and drops snoops that would find nothing.

    • It keeps snooping's simplicity for small groups while cutting most of the useless traffic.

    • Inclusive directories and filters must track every cached line; when an entry is evicted, the caches holding that line must be invalidated ("back-invalidation"), which costs performance if the filter is too small.

    How real protocols chose

    Protocol

    Finding copies

    AMBA ACE

    Snooping: the interconnect sends snoop requests on the AC channel to masters' caches, which reply on CR and CD (fact A23); interconnects commonly add snoop filters.

    AMBA CHI

    A home node per address range orders requests and sends snoops; designed for large, directory-style systems (fact A23).

    Large multi-socket systems

    Directories or directory caches at the memory's home, to avoid broadcasting across sockets.

    What breaks

    A many-core design (illustrative) used a snoop filter sized for the typical working set. Under one database workload, the filter thrashed: each eviction back-invalidated lines still in use, and those cores then missed on lines they had just been using. Throughput fell by a third. Enlarging the filter, and making it track lines per cluster rather than per core, fixed it.

    Why this matters

    Senior lens. Snooping versus directory is a trade of bandwidth and lookup power against latency and storage. Snoop on small clusters, use a directory or snoop filter across them, and size the filter against real working sets: a filter that thrashes turns a bandwidth saving into back-invalidations that hurt more than the snoops did.

    Interview

    Asked: "When does snooping stop scaling, and what replaces it?"

    Weak answer: When the bus is too slow.

    Strong answer: When the number of caches grows, because every miss is broadcast to every cache: snoop bandwidth and lookup power grow with core count times miss rate, and most caches have no copy. A directory replaces it: each line has a home that records which caches hold it, so requests go to the home and invalidations or forwards go only to actual holders. The cost is indirection, an extra hop through the home, and directory storage. Snoop filters sit between the two, dropping snoops to caches that certainly don't have the line.

    Follow-ups: (1) What is back-invalidation? (2) Who orders requests in a directory protocol?

    Check yourself In a directory system, a core reads a line no other cache holds. How many caches are snooped?

    None: the directory shows no holders, so memory supplies the line directly.

    Check yourself What orders conflicting requests in a snooping bus system, and in a directory system?

    The bus (every cache sees requests in the same order); in a directory system, the line's home node.

    Key takeaways

    • Snooping broadcasts every request; it is simple and fast but its traffic grows with the number of caches.

    • A directory records who holds each line and messages only them, at the cost of an extra hop and storage.

    • Snoop filters cut useless snoops; size them for real working sets to avoid back-invalidation.

    Keep going

    Next: Lesson 13.5, Ownership and Forwarding. Who supplies the data, and how many hops it takes.

    Related topics

    • Part 13 overview: Shared State and Coherence

    • Architecture course: Snoop or Directory

    Previous

    183 / 234

    Next: Ownership and Forwarding

    Up next

    Up nextOwnership and Forwarding

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Why Coherence
    • Invalidate or Update
    • Coherence and Consistency