retagged by
7,996 views
18 votes
18 votes

​​​​​​Assume a two-level inclusive cache hierarchy, $L1$ and $L2$, where $L2$ is the larger of the two. Consider the following statements.

  • $S_1$: Read misses in a write through $L1$ cache do not result in writebacks of dirty lines to the $L2$
  • $S_2$: 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?

  1. $S_1$ is true and $S_2$ is false
  2. $S_1$ is false and $S_2$ is true
  3. $S_1$ is true and $S_2$ is true
  4. $S_1$ is false and $S_2$ is false
retagged by

2 Answers

Best answer
17 votes
17 votes

$S_1:$ Read Miss in a write through $L1$ cache results in read allocate. No write back is done here, as in a write through $L1$ cache, both $L1$ and $L2$ caches are updated during a write operation (no dirty blocks and hence no dirty bits as in a write back cache). So during a Read miss it will simply bring in the missed block from $L2$ to $L1$ which may replace one block in $L1$ (this replaced block in $L1$ is already updated in $L2$ and so needs no write back). So, $S_1$ is TRUE.

$S_2:$ This statement is FALSE. Both write-through and write-back policies can use either of these write-miss policies, but usually they are paired in this way.

  • No write allocation during write through as $L1$ and $L2$ are accessed for each write operation (subsequent writes to same location gives no advantage even if the location is in $L1$ cache).
  • In write back we can to do write allocate in $L1$ after a write operation hoping for subsequent writes to the same location which will then hit in $L1$ and thus avoiding a more expensive $L2$ access.

Correct Answer: A.

Cache Writing Policies

selected by
2 votes
2 votes
Ans should be A.)
S1:- Read Miss results in read allocate and no writing is done here as in write through simultaneously l1 cache and l2 cache are updated during the write miss. So in Read miss it will simply go to l2 cache and bring the respected block from l2 cache to l1. Also no dirty bit is used in case of Write through.

S2:- No write allocation during write through as l1 and l2 are accessed simultaneously and in write back we need to do write allocate after updating the old block in l2 cache if dirty bit is 1 otherwise it will simply do write allocate to l1 cache.
Answer:

Related questions