8.2Baseline Directory System

book pp. 153–161 · ~4 min read

  • directory entry
  • three networks
  • AckCount/Inv-Ack machinery
  • A-means-Acks notation
  • explicit PutS

8.2.1–8.2.2 The system and the directory entry

The system is chapter 2’s baseline with the memory controller promoted to LLC/directory controller and a directory added. The network topology is deliberately vague — mesh, torus, whatever — with one assumption: point-to-point ordering on (at least) the forwarded-request network. For now: one directory entry per memory block, one monolithic LLC (§8.7.1 distributes it).

The baseline protocol is MSI; the block is owned by the directory unless some cache holds M. Each directory entry :

State2 bitsOwnerlog₂N bitsSharer list (one-hot bit vector)N bits — §8.5 shrinks this

Figure 8.2 (recreated): directory entry for a block, N-node system.

Two high-level transactions deserve the spotlight before the tables:

  • GetM with sharers: the directory sends the requestor Data plus the AckCount , sends Inv to every sharer — and each sharer Inv-Acks the requestor directly. Only after Data and all Inv-Acks arrive is the transaction complete.
  • PutM carries its data (unlike snooping’s PutM): otherwise the eviction would need a third message. The directory answers every Put with a Put-Ack . And note: no silent S evictions — replacement sends an explicit PutS (§8.7.4 debates this choice).

Try it: the live directory

Watch the directory entry (state, owner, sharer bits) evolve and the messages flow in the site-wide message colors. The preset walks a 2-hop GetS, a GetM with Invalidation/Inv-Ack, a 3-hop Fwd-GetS, and an explicit PutS:

Baseline MSI directory — one block

Core C1

I

Core C2

I

Directory / LLC

I

owner: · sharers: [00]

data: v0

Message log (one block) — requests · data · acks in the site-wide message colors

  1. ·Reset: all caches I; directory entry I (no owner, no sharers); LLC/memory holds v0.

8.2.3 Avoiding deadlock

Message receptions cause message sends. If a request and the response it triggers compete for the same FIFO queues, cycles form: in the book’s Figure 8.4, C1 and C2 each try to send a Data response while their incoming queues sit full of requests — nobody drains, the system deadlocks. The classic fix: separate networks per message class (physical or virtual). This protocol needs three, because requests cause forwarded requests, which cause responses:

ClassMessagesOrdering
RequestsGetS, GetM, PutM (and PutS)none required
Forwarded requestsFwd-GetS, Fwd-GetM, Inv, Put-Ackpoint-to-point
ResponsesData, Inv-Acknone required

A response can then never block behind a request, breaking every cycle. (Full deadlock theory arrives in §9.3.)

8.2.4 The detailed specification

Table 8.1 (recreated): MSI directory protocol — cache controller

Core eventsForwarded networkResponse network
StateLoadStoreReplacementFwd-GetSFwd-GetMInvPut-AckData from Dir (ack=0)Data from Dir (ack>0)Data from OwnerInv-AckLast-Inv-Ack

Cell format: action / next state (next state omitted when unchanged) · blank = event ignored · shaded = impossible. Click any cell or state chip.

Click a transition cell for its plain-English explanation, or a state chip for its invariants.

Three cells tell the section’s story — click them: ISD × Inv (the Data-vs-Inv cross-network race), IMA × Fwd-GetS (owner-on-paper without data — and why stalling is deadlock-safe), and SMAD × Inv (a lost upgrade race demoting to IM^AD, chapter 7’s window of vulnerability wearing directory clothes).

Table 8.2 (recreated): MSI directory protocol — directory controller

RequestsResponses
StateGetSGetMPutS (not last)PutS (last sharer)PutM+data from OwnerPutM+data from Non-OwnerData (from old owner)

Cell format: action / next state (next state omitted when unchanged) · blank = event ignored · shaded = impossible. Click any cell or state chip.

Click a transition cell for its plain-English explanation, or a state chip for its invariants.

The directory’s subtleties: the split PutS-Last / PutS-NotLast events (only a precise sharer list can tell, and only Last reclaims ownership → I), PutM from Non-Owner (a stale PutM from a cache that already lost a race — acknowledged and otherwise ignored), and S^D, where the directory stalls new Gets while the old owner’s data is in flight.

8.2.5–8.2.6 Operation, races, and the simplification bill

The common cases run exactly as the simulator shows. The interesting corners are the races born of multiple in-flight transactions:

  • Inv before Data (IS^D): the directory answered our GetS, then processed someone’s GetM — its Inv can beat its Data to us, since they ride different networks.
  • Fwd-GetS before the Inv-Acks (IM^A): the directory made us owner the instant it processed our GetM; a forwarded request can reach us before the sharers’ acks do.
  • Inv during an upgrade (SM^AD): the other GetM was ordered first — ack it, lose the copy, and continue as a full I→M.

The simplicity bill, paid twice: the controllers stall in these corners (a non-stalling variant with more transient states is §8.7.2’s business), and the directory sends full Data even to an S→M upgrader that already has valid data — the data-less AckCount message that fixes this waits for the MOSI protocol.

Check yourself

1.Why does this protocol need THREE networks (physical or virtual)?

2.The transient-state notation changed from chapter 7. What does IM^AD mean HERE?

3.A cache in IS^D (awaiting Data for its GetS) receives an Invalidation. How is that even possible, and what does the protocol do?

4.A cache in IM^A (data received, Inv-Acks outstanding) receives a Fwd-GetS. Why can it safely STALL that forward?

5.Why does this directory protocol's PutM CARRY the data, when snooping's PutM did not?

6.Why does this protocol use an EXPLICIT PutS, and why must the directory distinguish PutS-Last from PutS-NotLast?

6 questions