为什么我们在 mips 中使用写缓冲区?[缓存]

why we use write buffer in mips?[cache]

在Computer Architecture lecture上,我了解到write buffer的作用;保持等待写入内存的数据。我的教授刚刚告诉我它可以提高时间表现。

不过,我真的很好奇'how it improves time-performance'? 您能否更准确地解释一下写入缓冲区的工作原理?

论文Design Issues and Tradeoffs for Write Buffers描述写缓冲区的用途如下:

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.

换句话说,两个主要好处是:

  1. 如果处理器突发写入的速度快于缓存的响应速度,则写入缓冲区可以存储多个等待进入缓存的未完成写入。这提高了性能,因为其他一些指令不会被写入,因此它们可以继续执行而不是被停止。

  2. 如果对写缓冲区中的不同字进行多次写入而不是写入同一缓存行,则这些写入可以组合在一起成为对缓存行的一次写入。这提高了性能,因为它减少了需要进入缓存的写入总数(因为缓存行包含多个单词)。