Monday, June 3, 2013

Cache writings Policy

When the system writes data to the cache, then you must at some point in time the data is written to the memory, the write control point in time is that we have to discuss the cache write policy

Two basic write strategy is write-through and write-back:

write-through
CPU writes data to the cache, but also to write a memory, making the data cache and memory consistency. Advantage of being simple, does not appear cache coherence problem; shortcomings every time access memory, slow memory before returning to wait until the finish.

write-back
CPU cache data updates, just change it in the cache, memory content to wait until the data cache may be replaced or else do cache flush the system only when the update. Advantage is speed block; disadvantage is the introduction of cache and memory consistency issues. writeback complex needs than write-through, since it has been written to track cache contents, and then marked as dirty, so that the appropriate time to write back to the memory.

write-alloc
In another words, also known as fetch on write, if the data is not in cache to be written, then take data from memory into the cache, and then write (which led to the write-hit). Somewhat similar to the read-misses

In the area of ​​memory mapped on ARM, it will set two properties: bufferable and cacheable

bufferable mean having to put the results written into the final destination but only the middle of a buffer can be written back to the response, which is the above-mentioned write-back; non-bufferable the result is written into the final destination of the order back to the response, which is above the write-through.
Cacheable say is going to read and write cache when in view (noncacheable that do not have to cache in view, directly on the memory operation).

No comments:

Post a Comment