Question
Assume a two-level inclusive cache hierarchy, L1 and L2, where L2 is the larger of the two. Consider the following statements:
: Read misses in a write through L1 cache do not result in writebacks of dirty lines to the L2.
: 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?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2021 answer key
Solution
Evaluate the architectural behavior of inclusive cache hierarchies and cache write policies.
Evaluate statement :
In a write-through L1 cache, every write operation immediately updates both the L1 cache block and the corresponding block in the lower level (L2). Consequently, a block in a write-through L1 cache is never dirty (modified relative to L2). When an L1 read miss occurs and a line must be evicted, it is always clean and simply overwritten without needing a writeback to L2. Thus, is true.
Evaluate statement :
Write-allocate (allocating a cache line on a write miss) is traditionally paired with write-back caches to avoid repeated memory writes on subsequent writes to the same block. Write-through caches typically use no-write allocate (write-around) because writing directly to lower memory avoids bringing the block into cache on a miss. Statement claims the opposite, and asserts it as a mandatory requirement ('must'). Thus, is false.
Therefore, is true and is false, which corresponds to option A.
A
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 37 of 65, printed as CS Q.27
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.