What are the advantages and disadvantages of using write-through cache in cache coherence protocol?

We assumed using write-back caches in cache coherence protocols. It is possible to use write-through caches as well.

Advantages of using write-through caches:

  1. A significantly simpler two-state coherence protocol (Valid and Invalid). Stores write through the Last Level Cache (LLC) / memory, and invalidate all valid copies in other caches
  2. An L1 cache eviction requires no action besides changing the L1 state to Invalid, since LLC / memory always hold up-to-date data
  3. When the LLC / memory handle a coherence request, it can respond immediately
  4. A write-through cache improves fault tolerance. The L1 cache can just use parity since it can always just invalidate a cache line with a parity error

Disadvantage of using write-through cache:

  1. Significantly greater bandwidth and power to write data through to the next level of memory hierarchy. This effectively limits the write-through usage in L1 caches
  2. Write-through caches pose some challenges with multithreaded cores and shared L1 caches. In the Total Store Order (TSO) memory model, all threads (except for the thread performing the store) must see the store at the same time. For example, if thread T0 and T1 share the same L1 cache, T0’s store to an address must prevent T1 from accessing the new value until all copies in other caches have be invalidated or updated

Reference

A Primer on Memory Consistency and Cache Coherence (Second Edition), by Vijay Nagarajan, Daniel J. Sorin, Mark D. Hill, David A. Wood

Subscribe

Enter your email to get updates from us. You might need to check the spam folder for the confirmation email.

Leave a comment