Every senior trade-off question has the same shape: two designs that are both correct, and a workload or budget that decides between them. A strong answer names the deciding quantity, gives it a value or a condition, and says when the answer reverses. Use the answer framework: Assumption (the model and workload), Mechanism (what each design does), Trade-off (the deciding numbers), Evidence (what you would measure). Numbers below are illustrative and come from earlier lessons of this course, where they were computed.
Deciding quantity | Snooping (broadcast) | Directory |
|---|---|---|
Probe messages per miss | N-1 probes and N-1 responses: 14 at N = 8 | 2k for k recorded holders, plus a lookup at H: 4 at N = 8, k = 2 |
Metadata per 64-byte line (full bit vector) | None (each cache's state is the record) | 2 + N bits: 4 bits (0.78%) at N = 2, 66 bits (12.9%) at N = 64 |
Cache-to-cache miss | 2 legs on an ordered bus | 3 legs: requester, H, holder |
Model answer: at small N with an ordered broadcast medium, snooping wins on latency and needs no metadata. As N grows, probe traffic grows as N-1 per miss while actual sharing degree k usually stays small, so a directory or snoop filter pays once 2(N-1) probe messages per miss exceed the probe bandwidth budget. There is no universal core count: compute 2(N-1) against 2k with the measured k. Taught in Choosing Snoop or Directory, The Cost of Broadcast, Full Bit-Vector Cost.
Deciding quantity: r = total private capacity / LLC capacity. An inclusive LLC holds about the LLC size in unique lines; an exclusive one about LLC plus private capacity, so the relative gain is r. Two 256 KiB private caches over a 1 MiB LLC give r = 0.5: 1 MiB against 1.5 MiB. At r = 1/16 the gain is 6.25%. Model answer: with small r, inclusive costs little capacity and gives a free snoop filter (an LLC tag miss proves no private copy), at the price of back-invalidations and inclusion victims. With large r, non-inclusive or exclusive keeps the capacity but needs a separate snoop filter, and an exclusive LLC is filled by every private eviction, clean ones included. Taught in Policy Trade-Offs and Back-Invalidation.
Deciding condition: direct (three-hop) wins on the requester's critical path if and only if the delay of the holder-to-requester leg is less than holder-to-H plus H-to-requester. With equal legs that is 3 against 4, one leg saved. Model answer: three-hop shortens dirty misses, but H must learn the transfer finished (a completion message, off the requester's path) and the requester must handle a Fwd or Inv that arrives before its Data. It loses when the direct leg is congested (7 units against 2 + 2 in the course's check) or when every cache-to-cache data path is too costly to build. Taught in Three-Hop Versus Four-Hop and Racing Requests at the Home.
Worked on the course model: C0 S / 0 and C1 S / 0, C0 upgrades. With acks at H the critical path is GetM, Inv, Inv-Ack, Data: four serial legs. With acks at the requester, H sends Data with an ack count while Inv goes to C1, and C1's Inv-Ack goes to C0: three legs. Both send 2 + 2k messages for k sharers. Model answer: acks at the requester save one leg on every upgrade or write miss with sharers, at the cost of a requester that counts acks that may arrive before the Data carrying the total (a signed counter, the Primer's IM^AD and SM^AD). Acks at H keep the requester simple and give one place that knows the transaction is complete. The deciding number is the fraction of writes that hit shared lines times one leg of latency. Taught in the course model, Ack Counting and Late Data and Multicast and Ack Collection.
Deciding quantities: a queue that never refuses must hold every request that can be outstanding to one home, up to N cores times m MSHRs each (8 × 16 = 128 entries, illustrative). A NACK costs no reserved storage but two messages (request, NACK) per refused attempt, and needs a fairness rule. Model answer: queue when the worst case fits in area, because it gives natural order and no retry traffic. NACK when it does not, but reserve a slot or a retry token at NACK time, or serve oldest first, otherwise a request can be refused for ever (starvation) or two retriers can keep displacing each other (livelock). Many designs combine a small queue with NACK plus reservation. Taught in Retries, NACKs and Credits and Starvation Cases.
# not-run: illustrative worked arithmetic, values from the linked lessons
1. Snoop vs directory probes per miss 2(N-1) = 14 at N=8 directory 2k = 4 at k=2
metadata (2+N)/512: N=2 -> 0.78%, N=64 -> 12.9%
2. LLC inclusion r = private/LLC = 2 x 256 KiB / 1 MiB = 0.5
unique lines inclusive 1 MiB, exclusive 1.5 MiB
3. Three vs four hop direct wins iff d(C0->C1) < d(C0->H) + d(H->C1)
equal legs 3 < 4, congested 7 > 2 + 2
4. Acks at H vs req. serial legs 4 vs 3, messages 2 + 2k both
5. NACK vs queue never-refuse N x m = 8 x 16 = 128 entries
NACK cost 2 messages per refused attemptA directory or a snoop filter. Broadcast would send 31 probes and collect 31 responses per miss, 62 messages, against about 4 for two recorded holders, and without an ordered medium snooping would also need completion rules of its own. The cost to accept is the metadata: 34 bits per line for a full bit vector, about 6.6% of a 64-byte line, which is why limited-pointer or coarse entries are worth considering at this size.