Memory Hierarchy
For code that writes to the same line many times, why is a write-back cache more advantageous than write-through?
- AWrites complete within the cache, and memory is written only once when the line is evicted
- BMemory is updated on every write, so no work is needed at eviction
- CCache and memory always match, so no coherence management is needed
Show answer and explanation
Answer: A. Writes complete within the cache, and memory is written only once when the line is evicted
A write-back cache absorbs repeated writes to the same line within the cache and writes the dirty line back just once on eviction, greatly reducing memory traffic and power. Updating memory on every write is the write-through behavior, which generates traffic each time the line is written. Cache and memory always matching is also write-through; with write-back they differ for a while.
- A. Correct. Many writes collapse into one write-back at eviction.
- B. Updating memory on every write is write-through.
- C. Always matching is write-through; with write-back they can differ.