7.1Introduction to Snooping

book pp. 107–111 · ~5 min read

  • totally ordered broadcast
  • serialization point
  • implicit acknowledgment
  • requests vs. responses

Snooping protocols were the first widely deployed class of coherence protocols, and they still appear in a variety of systems. Their attractions: low-latency transactions and a conceptually simpler design than the alternative, directory protocols (chapter 8). This chapter introduces snooping (§7.1), builds a complete MSI baseline (§7.2), then layers on optimizations — the Exclusive state (§7.3), the Owned state (§7.4), and faster interconnects (§7.5, §7.6) — before two case studies (§7.7) and a look at snooping’s future (§7.8). (The book’s own note: casual readers may skim §7.3–7.6.)

One idea

All coherence controllers observe (snoop) coherence requests in the same order and collectively “do the right thing.” Requests are broadcast — traditionally on an ordered network like a bus — to every controller, including the requestor. Seeing the same requests in the same order is what lets the distributed per-block state machines stay mutually consistent.

Watch it work, then watch it fail. Both cores want block A in M (initially owned by the LLC/memory):

Table 7.1 — same per-block order everywhere

TimeCore C1Core C2LLC/Memory
0A: IA: IA: I (owner)
1GetM from C1 / MGetM from C1 / IGetM from C1 / M (not owner)
2GetM from C2 / IGetM from C2 / MGetM from C2 / M

✓ Ownership walks LLC → C1 → C2; SWMR holds at every step.

Table 7.2 — C2 sees a different per-block order

TimeCore C1Core C2LLC/Memory
0A: IA: IA: I (owner)
1GetM from C1 / MGetM from C2 / MGetM from C1 / M (not owner)
2GetM from C2 / IGetM from C1 / IGetM from C2 / M

✗ Time 1: two cores in M — SWMR violated. Time 2: nobody thinks it’s the owner — the next request gets no response (hello, deadlock).

Per-block order is not enough

Coherence needs only a per-block order — but traditional snooping builds a total order of coherence requests across all blocks, because consistency models like SC and TSO care about the interleaving of different blocks. In Table 7.3’s execution, each block is requested exactly once — per-block order is trivially satisfied — yet C2 observes C1’s GetM (block A) and its own GetS (block B) in an order that lets it read the new B but the old A:

TimeCore C1Core C2LLC/Memory
0A: I · B: M[0]A: S[0] · B: IA: S[0] · B: M
1A: GetM from C1 / M[0]; store A = 1A: S[0]
2A: M[1]; store B = 1 → B: M[1]A: GetM from C1 / M
3B: GetS from C2 / S[1]B: GetS from C2 / S[1]
4B: GetS from C2 / S[1]; r1 = B [1]
5r2 = A [0] — still S[0]!
6A: GetM from C1 / I (too late)

r1 = 1, r2 = 0 violates SC and TSO — even though coherence’s per-block orders all held.

With a total order (the book’s Table 7.4), the fix is automatic: C2 must process the GetM for A before the GetS for B, so once it reads B = 1 it can only read A = 1. Same start, same requests — but r1 = 1, r2 = 1.

Where the order comes from — and what it doesn’t constrain

However the network fixes the order, that mechanism is the protocol’s serialization (ordering) point . On a bus, it’s the arbitration logic: a request is ordered the instant arbitration serializes it — though a controller may only learn its request’s position several cycles later, by snooping the stream and seeing which requests precede its own.

Requests hog the attention; responses barely matter to ordering:

Check yourself

1.What is the one idea underlying all snooping protocols?

2.In Table 7.2, C2 observes the two GetM requests in the opposite order from C1 and the LLC. What goes wrong?

3.Coherence only needs a PER-BLOCK order of requests. Why do traditional snooping protocols build a TOTAL order across all blocks?

4.What is the IMPLICIT ACKNOWLEDGMENT that distinguishes snooping from directory protocols?

5.When does a snooping coherence transaction logically OCCUR, and what does that imply for response messages?

5 questions