Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why we use write buffer in mips?[cache]

On Computer Architecture lecture, I learned that the function of write buffer; hold data waiting to be written memory. My professor just told that it improves time performance.

However, I'm really curious 'how it improves time-performance'? Could you explain more precisely how write buffer works?

like image 717
고지웅 Avatar asked Nov 18 '15 15:11

고지웅


1 Answers

The paper Design Issues and Tradeoffs for Write Buffers describes the purpose of write buffers as follows:

In a system with a write-through first-level cache, a write buffer has two essential functions: it absorbs processor writes (store instructions) at a rate faster than the next-level cache could, thereby preventing processor stalls; and it aggregates writes to the same cache block, thereby reducing traffic to the next-level cache.

To put this another way, the two primary benefits are:

  1. If the processor has a burst of writes that occur faster than the cache can respond, then the write buffer can store multiple outstanding writes that are waiting to go to the cache. This improves performance because some of the other instructions won't be writes and thus they can continue executing instead of being stalled.

  2. If there are multiple writes to different words in the write buffer than go to the same cache line, then these writes can be grouped together into a single write to the cache line. This improves performance because it reduces the total number of writes that need to go to the cache (since the cache line contains multiple words).

like image 117
Gabriel Southern Avatar answered Oct 27 '22 20:10

Gabriel Southern