CPUs and architecture

Which correctly describes the write-back policy for caches?

  1. AWrites skip the cache and update only main memory
  2. BEvery write always updates both the cache and main memory
  3. COnly the cache is updated at first, and the data is written back to main memory when it is evicted from the cache
Show answer and explanation

Answer: C. Only the cache is updated at first, and the data is written back to main memory when it is evicted from the cache

Write-back caches update only the cache and write a dirty line to main memory when it is evicted. Many writes to the same location collapse into one write-back, drastically cutting memory traffic, so most CPU L1–L3 caches use it. Main memory and cache temporarily disagree, however, so coherence and consistency with DMA must be managed. Write-through updates both every time.

  • A. This describes writing without using the cache.
  • B. Updating both cache and memory every time is write-through.
  • C. Correct. Data is written back to main memory on eviction.