Write buffer: Difference between revisions
No edit summary |
fixing |
||
(6 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{ |
{{More citations needed|date=June 2019}} |
||
A '''write buffer''' is a type of [[data buffer]] used in certain [[CPU cache]] architectures like Intel's x86 and AMD64.<ref>Owens, Scott, Susmit Sarkar, and Peter Sewell. "A better x86 memory model: x86-TSO." Theorem Proving in Higher Order Logics. Springer Berlin Heidelberg, 2009. 391-407.</ref> In multi-core systems, write buffers destroy [[sequential consistency]]. Some software disciplines, like [[C11 (C standard revision)|C11's]] data-race-freedom,<ref>Oberhauser, Jonas. "A Simpler Reduction Theorem for x86-TSO." Verified Software: Theories, Tools, and Experiments. Springer International Publishing, 2015. 142-164</ref> are sufficient to regain a sequentially consistent view of memory. |
A '''write buffer''' is a type of [[data buffer]] that can be used to hold [[data]] being written from the cache to [[main memory]] or to the next cache in the [[memory hierarchy]] to improve performance and reduce [[latency (engineering)|latency]]. It is used in certain [[CPU cache]] architectures like Intel's x86 and AMD64.<ref>Owens, Scott, Susmit Sarkar, and Peter Sewell. "A better x86 memory model: x86-TSO." Theorem Proving in Higher Order Logics. Springer Berlin Heidelberg, 2009. 391-407.</ref> In multi-core systems, write buffers destroy [[sequential consistency]]. Some software disciplines, like [[C11 (C standard revision)|C11's]] data-race-freedom,<ref>Oberhauser, Jonas. "A Simpler Reduction Theorem for x86-TSO." Verified Software: Theories, Tools, and Experiments. Springer International Publishing, 2015. 142-164</ref> are sufficient to regain a sequentially consistent view of memory. |
||
A variation of [[write-through]] caching is called ''buffered write-through''.{{Citation needed|date=January 2022}} |
|||
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 [[Write combining|combines writes]] that have consecutive destination addresses into one buffer entry. Otherwise, they would occupy separate entries which increases the chance of pipeline stall. |
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 [[Write combining|combines writes]] that have consecutive destination addresses into one buffer entry. Otherwise, they would occupy separate entries which increases the chance of pipeline stall. |
||
Line 9: | Line 9: | ||
A '''victim buffer''' is a type of write buffer that stores dirty evicted lines in [[write-back]] caches<ref group=note>[[Write-through]] caches don't need write the evicted cache lines as they are written to main memory when the cache is written.</ref> 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 serve as a temporary backup storage when subsequent cache accesses exhibit [[Locality of reference|locality]], requesting those recently evicted lines, which are still in the victim buffer. |
A '''victim buffer''' is a type of write buffer that stores dirty evicted lines in [[write-back]] caches<ref group=note>[[Write-through]] caches don't need write the evicted cache lines as they are written to main memory when the cache is written.</ref> 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 serve as a temporary backup storage when subsequent cache accesses exhibit [[Locality of reference|locality]], requesting those recently evicted lines, which are still in the victim buffer. |
||
The |
The '''store buffer''' was invented by IBM during Project ACS between 1964 and 1968,<ref>{{Cite book|chapter-url=https://dl.acm.org/ft_gateway.cfm?id=1283945&type=pdf|doi = 10.1145/1283920.1283945|chapter = The search for performance in scientific processors|title = ACM Turing Award Lectures|year = 2007|last1 = Cocke|first1 = John|page = 1987|isbn = 978-1-4503-1049-9}}</ref> but it was first implemented in commercial products in the 1990s. |
||
==Notes== |
==Notes== |
||
{{Reflist|group=note}} |
{{Reflist|group=note}} |
||
==References== |
|||
{{reflist}} |
|||
{{DEFAULTSORT:Write Buffer}} |
{{DEFAULTSORT:Write Buffer}} |
||
[[Category:Computer memory]] |
[[Category:Computer memory]] |
||
Latest revision as of 15:29, 5 April 2023
This article needs additional citations for verification. (June 2019) |
A write buffer is a type of data buffer that can be used to hold data being written from the cache to main memory or to the next cache in the memory hierarchy to improve performance and reduce latency. It is used in certain CPU cache architectures like Intel's x86 and AMD64.[1] In multi-core systems, write buffers destroy sequential consistency. Some software disciplines, like C11's data-race-freedom,[2] are sufficient to regain a sequentially consistent view of memory.
A variation of write-through caching is called buffered write-through.[citation needed]
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 serve as a temporary backup storage when subsequent cache accesses exhibit locality, requesting those recently evicted lines, which are still in the victim buffer.
The store buffer was invented by IBM during Project ACS between 1964 and 1968,[3] but it was first implemented in commercial products in the 1990s.
Notes
[edit]- ^ Write-through caches don't need write the evicted cache lines as they are written to main memory when the cache is written.
References
[edit]- ^ Owens, Scott, Susmit Sarkar, and Peter Sewell. "A better x86 memory model: x86-TSO." Theorem Proving in Higher Order Logics. Springer Berlin Heidelberg, 2009. 391-407.
- ^ Oberhauser, Jonas. "A Simpler Reduction Theorem for x86-TSO." Verified Software: Theories, Tools, and Experiments. Springer International Publishing, 2015. 142-164
- ^ Cocke, John (2007). "The search for performance in scientific processors". ACM Turing Award Lectures. p. 1987. doi:10.1145/1283920.1283945. ISBN 978-1-4503-1049-9.