The day the caches disagreed: coherence, snooping and the MSI machine
After this lesson you will explain why two private caches can return different values for one address, state what a coherent memory promises, choose between write-invalidate and write-update, and run the MSI state machine of a snooping bus — replacements and write-backs included.
Two cores, A and B, each with a private cache, share one variable X; memory holds X = 1. A reads X, then B reads X: each cache now keeps its own copy of the 1. Then A writes X = 0. A moment later B reads X — and gets 1. No exception, no crash, no warning: an old value, served at cache speed. The notes print this story as Table 31 (p. 448), up to A's write.
Now the stranger part. "Almost all modern multiprocessors use write-back caches" (p. 448), so after A's write memory still holds 1 as well. Two of the three copies of X are wrong, and the only right one sits inside A's cache. A correct machine must still hand B the 0. Who warns B, and where does the 0 come from? By the end of the lesson you will trace the answer step by step.
Two caches, one X
Start from your first course: main memory is far too slow for the processor, so a cache keeps recently used blocks close to it. It lowers the average memory access latency and raises the effective bandwidth (p. 444). In a multiprocessor every core has private caches — L1 and L2 — and often shares an L3.
For private data — a thread's stack, its local variables — a private cache works exactly as in a single processor: no other core cares about the block. Shared data is different, and Hennessy & Patterson name two reasons to cache it anyway (§5.2; the notes do not use the words):
- Migration: a block moves into the cache of the core that uses it, so its accesses stop travelling to memory or across the interconnect — lower latency, less traffic.
- Replication: a block that several cores read gets a copy in each of their caches, so the readers do not queue for one copy.
Both benefits have one price: the same block now lives in several places. Table 31 of the notes shows what that costs, for one location X and two processors.
| T | Processor A | Processor B | Memory (X), write-through | Memory (X), write-back |
|---|---|---|---|---|
| 0 | 1 | 1 | ||
| 1 | Read X (1) → cache A = 1 | 1 | 1 | |
| 2 | Cache: A = 1 | Read X (1) → cache B = 1 | 1 | 1 |
| 3 | Write X = 0 → cache A = 0 | Cache: B = 1 | 0 | 1 |
| 4 | Cache: A = 0 | Read X → hit → 1 (stale) | 0 | 1 |
At T = 3 A writes 0 into its own copy. Nothing touches B's copy, so at T = 4 B reads 1 at hit speed. This is the cache coherence problem: "If one processor updates its cached copy, others may see an old value", and without extra mechanisms "this breaks the shared-memory programming model" (p. 444).
With write-back caches, the last column, memory keeps the 1 too: the only correct copy of X is in A's cache. The two write policies are those of lesson 23.
What a coherent memory promises
Table 31 breaks a promise. The notes state it in three conditions (p. 447), the same as Hennessy & Patterson's.
Coherent memory system — one in which:
- Program order preserved locally. If a processor writes X and then reads X, with no write by another processor in between, it reads back its own last write.
- Read sees the latest write (globally). A read of X by P2 after a write to X by P1 returns P1's value, provided enough time has passed and no other write to X happened in between.
- Write serialization. All processors see the writes to one location in the same order: if P1 writes X = 1 and then P2 writes X = 2, no core observes 2 and later 1.
On p. 444 the notes sum coherence up in two terms: condition 2 is write propagation — every processor eventually sees the new value — and condition 3 is write serialization. Condition 1 is the uniprocessor rule that you read back your own writes. Table 31 fails condition 2: B reads its stale 1 for as long as the block stays in its cache.
Coherence in one line: reads return the most recent value written to the address, and only one writer can "own" the data at a time; all other copies must be invalidated or updated (p. 447).
Coherence is not consistency
Coherence speaks about one location at a time. Memory consistency is a separate question: when does a write become visible to the other processors, and in what order do writes to different locations appear (p. 444)? The notes' example (pp. 444–445):
P0: A = 1; P1: print(B);
B = 2; print(A);
A and B start at 0. If P1 prints B = 2, must it then print A = 1? Under sequential consistency, yes: the result must look like one interleaving of the two programs, each in its own order, so P1 can print (B, A) = (0, 0), (0, 1) or (2, 1), never (2, 0). Weaker, relaxed models allow (2, 0), for example when write buffers or out-of-order execution reorder P0's writes or P1's reads. Each location stays coherent all the while — A and B receive one write each. So "even if the system is coherent, without consistency rules we don't know when other processors see writes, or in what order" (p. 445). The "enough time" of condition 2 is what a consistency model pins down; this lesson is about coherence.
Two cures: invalidate or update
To stop B from reading its 1, the hardware must act when A writes. Two independent questions decide how (p. 445): what the other caches are told — the coherence policy — and how they are told — the hardware organisation (Fig. 1).
Snooping broadcasts every request on a shared bus and suits small symmetric multiprocessors with one uniform memory (SMP/UMA); a directory sends messages only to the caches that hold a copy and suits large DSM/NUMA machines (p. 445; the machines are those of lesson 34, the directory is lessons 37–38). The policy says what those messages carry:
Before writing, the writer puts an invalidate on the bus. Every other cache that holds the block marks it Invalid; the writer now has exclusive ownership, and its further writes are local and silent until another processor asks for the block (pp. 447, 452).
Cost: a reader that wants the block later misses and must fetch it from the writer or from memory.
On every write, the writer broadcasts the new value to all caches that hold the block, which update their copies in place; memory is usually updated too (p. 452).
Readers never miss and never see stale data. Cost: every single write uses the bus.
The before / after pair shows the invalidate cure at the moment of B's read.
Before: no protocol
After: write-invalidate
Table 32 of the notes (p. 448) is this cure with write-back caches; its numbers are swapped — X starts at 0 and A writes 1. The notes drop the bus column of Hennessy & Patterson's original. It is back here, because the bus is what you must reason about.
| T | Processor A | Processor B | Bus activity | Mem (X) |
|---|---|---|---|---|
| 0 | 0 | |||
| 1 | Read X → cache miss → A = 0 | Read Miss for X; memory supplies 0 | 0 | |
| 2 | Cache: A = 0 | Read X → cache miss → B = 0 | Read Miss for X; memory supplies 0 | 0 |
| 3 | Write X = 1 → cache A = 1 (dirty) | B's copy of X invalidated | Invalidate for X | 0 |
| 4 | Cache: A = 1 | Read X → cache miss → B = 1 | Read Miss for X; A supplies 1, memory written back | 1 |
Row 4 holds two facts that everything below relies on. The data comes from A's cache, not from memory: A holds the only fresh copy. And memory becomes 1 although no processor stored to it: while A answers, memory takes the block from the bus — A's block is written back.
Why invalidate won
Both cures are correct; they differ in traffic. Hennessy & Patterson trace the difference to three characteristics of programs, and the first two favour invalidation:
- Several writes to the same word with no read in between: invalidate pays one transaction, update pays one per write.
- Writes to several words of the same block: invalidate pays once per block, update once per word.
- The delay between a write and another processor's read of the value is shorter with update, because the value is already in the reader's cache: the reader hits instead of missing. That is update's one advantage, and it pays off for producer–consumer sharing.
Programs write the same blocks again and again, so the notes' verdict holds: invalidate saves bandwidth and dominates, update lowers read latency "but consumes lots of bandwidth" (p. 452). Update protocols did exist — Firefly and Dragon are the classic ones — but today's processors invalidate. The meter makes the three characteristics countable.
Snooping: every cache listens to the bus
In a small multiprocessor all processors and the memory hang on one bus (p. 449). The bus is a broadcast medium: a request placed on it is seen by every cache controller at the same time. So every controller snoops: it watches every transaction, and if one concerns a block it holds, it reacts — it invalidates its copy, or supplies its data. One transaction informs everybody, and no directory or central record is needed.
The bus gives one more thing, which the notes file under the costs with only a nod to correctness: a single global order. One transaction at a time means that every controller sees all requests in the same order — and that is write serialization, condition 3, for free. If two processors write the same block at once, both ask for the bus; the winner's Invalidate kills the loser's copy, and the loser's write becomes a miss that fetches the winner's value.
The same broadcast is why snooping does not scale (p. 449):
- Bandwidth. Every coherence transaction goes to all processors; with more processors the traffic grows until the bus saturates.
- Electrical limits. Every attached controller adds load — fan-out — and capacitance, so a signal needs longer to reach the farthest receiver and the bus cycle must slow down.
- Serialization. The global order that gives correctness also forbids two coherence actions in parallel.
In practice snooping serves "2-8 CPUs" (p. 449); the notes' answer to the January 2026 paper allows "typically up to 16 or 32" (p. 495). Tens or hundreds of cores need a directory (lessons 37–38); why one bus saturates is in lesson 33.
Duplicate tags: snooping without stealing cycles
Every bus transaction must be checked against the tags of every cache (p. 450). But the tag array is already busy: the local processor looks it up on every load and store. Without help, either the processor stalls while the snoop uses the tags, or the snoop waits — and a late reaction risks a coherence violation. Two users, one resource, one cycle: a structural hazard.
The fix is a duplicate tag array, the snoop tag store, used only by the snooper (Fig. 3). Each entry holds the tag and the coherence state, no data, so it has as many entries as the main tag array but is far smaller than the cache. Bus transactions are checked there, every cycle, while the main tags keep serving the processor; every allocation, eviction and state change is written into both copies. The price is silicon area; the gain is a pipeline that does not stall "just from coherence traffic" (p. 451).
The MSI machine
MSI is the basic write-invalidate protocol for write-back caches on a snooping bus (p. 453). Each block of each private cache runs its own small finite-state machine. A cache block already carries a valid bit and a dirty bit; MSI gives that pair three meanings (p. 453):
| State | valid | dirty | Meaning |
|---|---|---|---|
| M — Modified | 1 | 1 | the only copy, dirty (different from memory); written back before it leaves the cache |
| S — Shared | 1 | 0 | a clean copy, identical to memory; other caches may hold copies too |
| I — Invalid | 0 | — | no valid copy |
"Shared means that two or more caches hold the block." No: Shared means clean and possibly shared. In MSI every read miss ends in S, even when no other cache has a copy, so the first write must still send an Invalidate.
Two sources move the machine (p. 453): requests of the local processor, and requests of other caches seen on the bus. The notes and Hennessy & Patterson call the bus transactions Read Miss, Write Miss and Invalidate, the names the exam papers give the directory messages. This lesson keeps them, writes the local processor's read and write as PrRd and PrWr, and labels every arrow "event / action".
| This lesson | Meaning; the notes' Fig. 38 (p. 456) and other texts |
|---|---|
| PrRd, PrWr | the local processor reads or writes the block. Fig. 38: read / write hit or miss, straight arrows |
| Read Miss | on the bus: another cache wants a readable copy. Fig. 38: Read Miss, wavy arrow; other texts: BusRd |
| Write Miss | on the bus: another cache wants to write a block it does not hold — one transaction fetches it and invalidates all other copies. Other texts: BusRdX |
| Invalidate | on the bus: another cache holds the block in S and wants to write it — invalidation only, no data. Fig. 38: Inv.; other texts: BusUpgr |
| write-back | the owner of an M block puts it on the bus and memory takes it. Other texts: Flush |
Walk the warm-up's block through the machine before the general picture: two caches, memory holds X = 1.
| T | After operation | A | B | Bus transaction | Memory up to date? |
|---|---|---|---|---|---|
| 1 | A: read X | Shared | Invalid | Read Miss; memory supplies 1 | Yes |
| 2 | B: read X | Shared | Shared | Read Miss; memory supplies 1 | Yes |
| 3 | A: write X = 0 | Mod | Invalid | Invalidate | No |
| 4 | B: read X | Shared | Shared | Read Miss; A supplies 0 and writes it back | Yes |
The whole machine in two tables
| State | PrRd | PrWr | replacement |
|---|---|---|---|
| I | → S [Read Miss] | → M [Write Miss] | — (nothing to evict) |
| S | hit, stay S | → M [Invalidate] | → I, silent |
| M | hit, stay M | hit, stay M | → I [write-back] |
| State | Read Miss | Write Miss | Invalidate |
|---|---|---|---|
| I | nothing to do | nothing to do | nothing to do |
| S | stay S; memory supplies | → I | → I |
| M | → S [supply, write-back] | → I [supply, write-back] | cannot happen |
Exactly three processor accesses put a request on the bus (p. 457): a read miss (I → S, Read Miss), a write miss (I → M, Write Miss) and a write hit in S (S → M, Invalidate). Every other hit is silent.
A write hit in M needs nothing: the cache already owns the only copy. The one other CPU-side use of the bus is not a request but a write-back, when a block in M is replaced. On the bus side, a Read Miss leaves a Shared copy alone — memory supplies the data — but makes a Modified copy supply the block and drop to S; a Write Miss kills any copy, an Invalidate a Shared one.
The hidden arrows: replacement
Fig. 38 of the notes leaves out the transitions that every exam table uses. The papers assume "one cache block per processor", so an access to the other block misses and evicts the block that is there. From the evicted block's point of view: M → I with a write-back — memory becomes up to date — and S → I silently, because a clean copy loses nothing. Then the new block enters through the normal miss arrow, I → S or I → M.
Three ways to leave M, three write-backs
A block is written back only when it leaves M (p. 457; the eviction case appears only in the notes' definition of M, p. 453):
- M → S on a snooped Read Miss: the owner supplies the block, and memory takes it.
- M → I on a snooped Write Miss: the owner supplies the block, then drops its copy.
- M → I on a replacement: the dirty block is written back before the line is reused.
Hence the rule behind the column "Memory at bl. 0 up to date?" of every exam table: memory is up to date exactly while no cache holds the block in M. It turns No at the write that moves a block into M, and back to Yes at the write-back that moves it out.
Back to the warm-up. With MSI, A's write at T = 3 found X in S and put an Invalidate on the bus: B's copy went to I. B's read at T = 4 missed and put a Read Miss on the bus; A snooped it, supplied the 0 and wrote the block back, M → S. Between T = 3 and T = 4 memory was wrong and nothing broke, because no processor could read the wrong copy. Coherence is a promise about what every read returns, not about what memory holds.
Exam-style questions
Explain the main concepts and benefits of each one of the following techniques used to keep the private caches of a shared-memory multiprocessor coherent:
1. Caching of shared data (migration and replication); 2. Cache coherence; 3. Memory consistency; 4. Write-invalidate protocol; 5. Write-update protocol; 6. Snooping protocol; 7. Duplicate snoop tags; 8. MSI protocol.
Show model answer
1. A private cache keeps a copy of a block next to the core. For shared data it gives migration — the block moves to the cache of the core using it, so accesses no longer go to memory or over the interconnect — and replication — a read-shared block gets a copy in every reader's cache, so readers do not contend for one copy. Benefit: lower latency, less bus and memory traffic. Cost: several copies of one block, hence the coherence problem.
2. A memory system is coherent if (1) a processor that writes X and then reads X, with no other write in between, reads its own value; (2) a read of X by P2 after a write by P1 returns P1's value if enough time has passed and no other write intervened; (3) writes to the same location are serialized: all processors see them in the same order. It concerns one location at a time.
3. Consistency defines when a write becomes visible to the other processors and in which order loads and stores to different addresses may be observed. Example: P0 writes A = 1 then B = 2, P1 reads B then A: sequential consistency forbids reading B = 2 and A = 0, relaxed models allow it. A coherent memory need not be sequentially consistent.
4. Before writing a shared block, the writer broadcasts an invalidate; all other copies become Invalid and the writer gets exclusive ownership. Further writes are local and silent until another processor requests the block; that processor misses and gets the data from the owner or from memory. Benefit: traffic only on the first write — the choice of almost all modern multiprocessors, with write-back caches.
5. Every write broadcasts the new value to all caches holding the block (and usually to memory), which update their copies. Benefit: readers never miss and never see stale data. Cost: one bus transaction per write, also for repeated writes to one word or to the words of one block, so it wastes bandwidth; it pays off only for producer–consumer sharing.
6. The caches share a bus, which is a broadcast medium: every cache controller monitors every transaction and reacts if it holds the block (invalidates it or supplies the data). No central directory; one transaction informs all caches; the bus order serializes the writes. Suitable for small symmetric (UMA) multiprocessors; it does not scale, because broadcast traffic, electrical load and serialization grow with the number of processors.
7. A second copy of the cache's tag array — tag and coherence state, no data — used only by the snooper. Bus transactions are checked there while the processor keeps using the main tags, so snooping does not stall the pipeline: it removes the structural hazard on the tag array. Cost: area, and both copies must be updated together.
8. Each block is Modified (only copy, dirty), Shared (clean, possibly in other caches) or Invalid. A read miss puts a Read Miss on the bus (→ S), a write miss a Write Miss (→ M), a write hit in S an Invalidate (→ M); read hits and write hits in M are silent. A snooped Read Miss turns M into S with a write-back; a snooped Write Miss turns S or M into I (M supplies the block and writes it back first); a snooped Invalidate turns S into I. A replaced Modified block is written back, a replaced Shared block leaves silently.
This is the format of the 8-point question of the 22 June 2026 paper, with about five lines per sub-point. Each line should name the mechanism and its benefit; points 4–6 together answer the snooping half of Question 1 of the January 2026 paper as the notes reproduce it (pp. 495–497). The usual slip is in point 2: "every processor sees a write immediately" — the definition says "after enough time", and the timing belongs to consistency.
Let's consider a single-chip dual-core shared-memory architecture where each core is a dual-issue superscalar processor with multi-threading up to 2 threads per core. Explain the preferred technique used to manage the cache coherency problem in the dual core chip.
Show model answer
A snooping, write-invalidate protocol with write-back caches (MSI, in practice MESI). The private caches of the two cores sit on a shared on-chip bus that acts as a broadcast medium: each cache controller monitors every transaction, with duplicate snoop tags, and keeps a coherence state per block. Before a core writes a block that the other core may hold, it broadcasts an invalidate, so the other copy becomes Invalid and later writes stay local. A read miss on a block that the other cache holds Modified is served by that cache, which writes the block back and goes to Shared. With two cores the broadcast is cheap and the bus serializes the writes, so no directory is needed — directories are for many nodes with distributed memory.
This is the last row of Question 2 (5 points in all) of the 10 June 2025 paper. A good answer names snooping, write-invalidate and write-back, and gives the reason: two cores on one chip share a broadcast medium. Naming MESI, the refinement of lesson 36, adds precision; a directory answers a different machine.
Let's consider the following access patterns on a dual processor system with a direct-mapped, write-back cache with one cache block per processor and a two cache block memory. Assume the MSI protocol is used, with write-back caches, write-allocate, and write-invalidate of other caches. Please complete the following table. How many times is a block written back to memory, and in which cycles?
| Cycle | After Operation | P0 cache block state | P1 cache block state | Memory at bl. 0 up to date? | Memory at bl. 1 up to date? |
|---|---|---|---|---|---|
| 0 | P0: Read Bl. 0 | Shared (0) | Invalid | Yes | Yes |
| 1 | P1: Read Bl. 0 | ||||
| 2 | P1: Write Bl. 0 | ||||
| 3 | P1: Write Bl. 0 | ||||
| 4 | P0: Read Bl. 0 | ||||
| 5 | P0: Write Bl. 1 | ||||
| 6 | P1: Read Bl. 1 | ||||
| 7 | P1: Write Bl. 0 | ||||
| 8 | P1: Read Bl. 1 | ||||
| 9 | P0: Write Bl. 1 | ||||
| 10 | P1: Write Bl. 1 |
Show model answer
| Cycle | After Operation | P0 cache block state | P1 cache block state | Memory at bl. 0 up to date? | Memory at bl. 1 up to date? | Bus transaction (comment) |
|---|---|---|---|---|---|---|
| 0 | P0: Read Bl. 0 | Shared (0) | Invalid | Yes | Yes | Read Miss; memory supplies |
| 1 | P1: Read Bl. 0 | Shared (0) | Shared (0) | Yes | Yes | Read Miss; memory supplies |
| 2 | P1: Write Bl. 0 | Invalid | Mod (0) | No | Yes | write hit in S: Invalidate |
| 3 | P1: Write Bl. 0 | Invalid | Mod (0) | No | Yes | write hit in M: none |
| 4 | P0: Read Bl. 0 | Shared (0) | Shared (0) | Yes | Yes | Read Miss; P1 supplies and writes back |
| 5 | P0: Write Bl. 1 | Mod (1) | Shared (0) | Yes | No | P0 drops Shared (0) silently; Write Miss |
| 6 | P1: Read Bl. 1 | Shared (1) | Shared (1) | Yes | Yes | P1 drops Shared (0) silently; Read Miss; P0 supplies and writes back |
| 7 | P1: Write Bl. 0 | Shared (1) | Mod (0) | No | Yes | P1 drops Shared (1) silently; Write Miss |
| 8 | P1: Read Bl. 1 | Shared (1) | Shared (1) | Yes | Yes | P1 writes back block 0 (replacement); Read Miss; memory supplies |
| 9 | P0: Write Bl. 1 | Mod (1) | Invalid | Yes | No | write hit in S: Invalidate |
| 10 | P1: Write Bl. 1 | Invalid | Mod (1) | Yes | No | Write Miss; P0 supplies, writes back, invalidates |
Four write-backs: cycles 4 and 6 (a Modified block answers a Read Miss: M → S), cycle 8 (a Modified block is replaced: M → I) and cycle 10 (a Modified block answers a Write Miss: M → I).
The wording is that of the MESI tables of the papers (Exercise 3 of January 2026 as the notes reproduce it, Quiz 7 of June 2026) with MSI in place of MESI. The traps: the silent write hit in M (cycle 3); the owner's write-back that turns "up to date" back to Yes (cycles 4, 6); the silent eviction of a Shared block, which leaves the other copy untouched (cycles 5–7); the write-back on the replacement of a Modified block (cycle 8). The four write-backs cover all three ways of leaving M. Under MESI (lesson 36) only cycle 0 would change: Excl (0).
Processors P0 and P1 both hold block X in their write-back caches. P0 then writes X ten times in a row, while P1 does not access it. How many coherence transactions appear on the bus under a write-invalidate protocol and under a write-update protocol?
Show model answer
Answer: 1 and 10. Write-invalidate sends one invalidation for the first write; the block is then exclusively owned and the remaining writes are local. Write-update broadcasts every write.
This is the first of Hennessy & Patterson's three characteristics, in numbers, and the slope of the traffic meter. A "motivate your answer" line would be: invalidation is per block and per ownership, update per write.
How does an MSI write-invalidate write-back protocol manage a Write Hit on a cache block which is Shared in another cache? (Multiple answers.)
Show model answer
Answers 1, 4 and 5: an invalidate is broadcast, the block is written in the cache and becomes Modified; nothing is retrieved because the block is already present.
Quiz 2 of the 22 June 2026 paper asks exactly this for MESI, and in MESI the answer is the same. Its Quiz 1 — a write hit on an Exclusive block — needs the E state of lesson 36.
True or false: in an MSI snooping protocol with write-back caches, after a cache that holds a block in Modified state answers another processor's read miss, main memory holds an up-to-date copy of the block.
Show model answer
True. On the snooped read miss the Modified copy is written back while it is supplied; both caches end in Shared and memory is up to date.
Row 3 of the table in Quiz 7 of the 22 June 2026 paper — one of its correct rows — prints exactly this: P3 reads block 0 while P1 holds it Modified, and "Memory at bl. 0 up to date?" becomes Yes. The notes argue the opposite on p. 455; see the red pen in section 5.
Check yourself
Table 31 with write-back caches: right after A writes X = 0 (T = 3), where is the value 0?
P0 runs A = 1; B = 2; and P1 runs print(B); print(A). The machine is coherent but not sequentially consistent, and P1 prints 2 and then 0. Is coherence violated?
Which events of P0's own processor make P0's MSI controller put something on the bus? Select all that apply.
Three processor accesses put a request on the bus: I → S, S → M and I → M (a write of an Invalid block, not listed here). The eviction of a dirty block adds a write-back.
P0 holds X in M. P1 puts a Read Miss for X on the bus. After the transaction:
Why does a snooping bus give write serialization, condition 3 of coherence, without extra hardware?
What does a duplicate (snoop) tag array hold, and which problem does it solve?
For which access pattern does write-update put fewer transactions on the bus than write-invalidate?
Key take-aways
- Private caches serve private data as in a single processor; for shared data they bring migration and replication, at the price of several copies of one block — and without a protocol a processor silently reads a stale copy.
- A coherent memory guarantees that a processor reads back its own writes, that a read sees another processor's write after enough time, and that writes to one location are serialized; consistency is the separate question of ordering across locations.
- Write-invalidate pays one transaction for the first write and makes later readers miss; write-update pays one per write; invalidation won because writes repeat.
- A snooping bus broadcasts every request and gives one global order, hence write serialization for free; broadcast traffic, electrical load and serialization limit it to small machines, and duplicate snoop tags keep the snooper from stalling the processor.
- In MSI exactly three processor accesses put a request on the bus (read miss: Read Miss, I → S; write miss: Write Miss, I → M; write hit in S: Invalidate, S → M); a snooped Read Miss turns M into S, a snooped Write Miss turns S or M into I, and a snooped Invalidate turns S into I.
- Replacements are the hidden arrows of every exam table: M → I with a write-back, S → I silently; memory is up to date exactly while no cache holds the block in M.
What to watch and read
-
Coherence Definition
Milos Prvulovic, Georgia Tech (Udacity)
A few minutes on what "coherent" means, from Georgia Tech's architecture course — a warm-up for section 2.
-
MSI Cache Coherence Protocol Simulator
IIIT Hyderabad, Virtual Labs
Two processors, PrRd and PrWr buttons, a state diagram that lights up and a log that separates processor and bus activity. Replay the widget's runs there, predicting each state first. It implements MSI only, despite its address.
-
Update VS Invalidate Coherence
Milos Prvulovic, Georgia Tech (Udacity)
The comparison of section 3 from the same course. Watch it after the traffic meter and check its argument against your own counts.
-
MSI Coherence
Milos Prvulovic, Georgia Tech (Udacity)
The MSI state machine built transition by transition — compare it with Fig. 4 and check that the bus actions match.
-
Computer Architecture — Lecture 20: Cache Coherence (Fall 2021)
Onur Mutlu, ETH Zürich
The whole arc of lessons 35–38 in one lecture: the coherence problem, snooping against directories, MSI to MESI. Good preparation for the 8-point open question.