Jump to content

Write buffer

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by BG19bot (talk | contribs) at 23:04, 14 October 2015 (WP:CHECKWIKI error fix for #64. Do general fixes if a problem exists. - using AWB (11700)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A write buffer is a type of data buffer used in certain CPU cache architectures.

In a CPU cache, a write buffer can be used to hold data being written from the cache to main memory or to the next cache in the memory hierarchy. This is a variation of write-through caching called buffered write-through.

Use of a write buffer in this manner frees the cache to service read requests while the write is taking place. It is especially useful for very slow main memory in that subsequent reads are able to proceed without waiting for long main memory latency. When the write buffer is full (i.e. all buffer entries are occupied), subsequent writes still have to wait until slots are freed. Subsequent reads could be served from the write buffer. To further mitigate this stall, one optimization called write buffer merge may be implemented. Write buffer merge combines writes that have consecutive destination addresses into one buffer entry. Otherwise, they would occupy separate entries which increases the chance of pipeline stall.

A victim buffer is a type of write buffer that stores dirty evicted lines in write-back caches[note 1] so that they get written back to main memory. Besides reducing pipeline stall by not waiting for dirty lines to write back as a simple write buffer does, a victim buffer may also serves as a temporary backup storage when subsequent cache accesses exhibit locality, requesting those recently evicted lines, which are still in the victim buffer.

Notes

  1. ^ Write-through caches don't need write the evicted cache lines as they are written to main memory when the cache is written.