Assume a two-level inclusive cache hierarchy, and , where is the larger of the two. Consider the following statements.
- : Read misses in a write through cache do not result in writebacks of dirty lines to the
- : Write allocate policy must be used in conjunction with write through caches and no-write allocate policy is used with writeback caches.
Which of the following statements is correct?
View worked solution
Answer: A
Let us analyze the two statements individually:
Statement : True
- In a write-through cache, every write operation updates both the cache and the next level ( cache) simultaneously.
- Because of this, the data in is always consistent with , meaning never contains any "dirty" lines (lines modified in but not updated in ).
- When a read miss occurs in , a line may need to be evicted to make room for the new line. Since there are no dirty lines in , no writeback to is ever required.
Statement : False
- The pairing of write policies is typically as follows:
- Write-back caches are commonly paired with write-allocate to ensure that subsequent writes to the newly allocated block happen quickly in the cache.
- Write-through caches are commonly paired with no-write-allocate (write-around) because writing directly to the lower level anyway makes bringing the block into on a write miss unnecessary.
- The statement asserts the exact opposite and claims it "must" be used, which is incorrect.
Thus, is true and is false.
Free practice · Your answers on this page are not saved.
