Cache Coherence Flashcards
What is write-update coherence?
Broadcast writes to other cores and update their caches
What is write-invalidate?
invalid other cores’ caches on a write
What is cache snooping?
write broadcasts on a shared bus, the order of broadcasts on shared bus is the order the writes are updated in each cache
What is directory coherence?
each block is assigned an ‘ordering point’
How does snooping ensure read/write order?
Cores must arbitrate broadcasts on the bus
How can we reduce reads/writes to memory?
Add a dirty bit, update memory when the block is removed from the cache. A core with a dirty bit set responds to reads from other cores. Only 1 core can have a dirty bit set at a time
How do we reduce writes to the bus?
Add shared bit to indicate if this block is stored in other caches. Add an extra bus line to signal if another cache has a block in the cache when another one reads/writes
What are the pros/cons of write-invalidate snooping?
(-) always have a miss on a read when other caches write
(+) after a write, all reads/writes are local to that cache until another cache performs a read/write
What type of coherence do most modern processors use and why?
Write-invalidate. Write-update has very bad performance when a thread is switched to another core (because it has to keep updating the old addresses)
What is the Invalid state?
block is not in the cache or block is in the cache with a valid bit == 0
What is the Shared state?
Block is unmodified (may be in 1 or more caches) and contains the same data as memory. block can be read without updating other cores, but must notify other cores if a write occurs
What is the modified state?
There are no other copies of this block in other caches and it has changes to it. Can read and write to the block without sending any messages to other cores
What are the ways to implement cache-to-cache transfers?
- Abort/retry - C1 aborts C2’s read request and writes block back to memory. C2 must try again later
- Intervention - C1 sends intervention signal to memory (“I will respond” and updates memory value). C1 responds to C2 with value
For modified state!
What is the improvement of MOSI over MSI?
MSI and cache-to-cache transfers have a lot of writes to memory, MOSI looks to improve thiis
In MSI coherence, when does a cache respond to another cache’s read/write request?
Only during a read in the M state (shared state reads go to memory)