Embedded Systems

Write-through and write-back data cache policy

write-through vs write-back cache

Data cache operates in two modes:

  • write-through;
  • write-back.

In case of write-through mode data is written in cache and in source memory when it is modified. No matter how many times data is modified in cace memory, it is the same amount of times modified in source memory as well. This mode can impact performance due to huge traffic through the bus between cache and source memory.

Write-back mode means that data is written only in cache. And when it is being replaced in cache memory it is written in back in source memory. Then source memory is always written only once.

Comparing these two modes – write-back one is faster as memory source data is used only once.

Important note is that this dual approach is used only with data cache, but not with instruction cache.

Tags: