This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ACHE MEMORIES 319 The situation for writes is a little more complicated. Suppose the CPU writes a word Û that is already cached (a write hit). After the cache updates its copy of Û, what does it do about updating the copy of Û in memory? The simplest approach, known as write-through, is to immediately write Û’s cache block to memory. While simple, write-through has the disadvantage of causing a write transaction on the bus with every store instruction. Another approach, known as write-back, defers the memory update as long as possible by writing the updated block to memory only when it is evicted from the cache by the replacement algorithm. Because of locality, write-back can signiﬁcantly reduce the number of bus transactions, but it has the disadvantage of additional complexity. The cache must maintain an additional dirty bit for each cache line that indicates whether or not the cache block has been modiﬁed. Another issue is how to deal with write misses. One approach, known as write-allocate, loads the corresponding memory block into the cache and then updates the cache block. Write-allocate tries to exploit spatial locality of writes, but h...
View Full Document
- Spring '10
- The American