110 likes | 501 Views
Writing Data to the Cache. When executing a program, some information may need to be written into memory using either write-through or write-back. Write-through: Every time a value is written from CPU into a location in cache, it is also written to the
E N D
1. More about Cache Writing Data to the Cache
Cache Performance
Average Memory Access Time
2. Writing Data to the Cache When executing a program, some information may need to be written into memory using either write-through or write-back.
Write-through: Every time a value is written from CPU into a location in cache, it is also written to the corresponding location in physical memory
Guarantees that physical memory is correct
Requires additional time to write to physical memory
Write-back: The value written to cache is not always written to physical memory
Saves time
3. Write-through + Write-back Example For I = 1 to 1000
x = x +1
With write-through every value of x will be written to memory
While write-back only the final value will be saved into physical memory
4. Additional Stuff Since a processor cannot take data from another processor's cache, the physical memory should have the most current value
Write miss: Write miss writes data to locations not currently loaded into the cache
Write-allocate policy: Loads the location into cache then writes the new value to cache using write-back or write-through
Write-no allocate policy: Updates the value in physical memory without loading it into the cache.
5. Additional Stuff Con't. Sooo write-back policy usually uses write-allocation
While write-through policy usually uses write-no allocation.
6. Average Memory Access Time
7. Examples of Memory Access Time
8. More Examples
9. More Examples
10. More Examples
11. References