Assume a two-level inclusive cache hierarchy, L1 and L2, where L2 is the…

2021

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

S1: Read misses in a write through L1 cache do not result in writebacks of dirty lines to the L2

S2: 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. A.

    S1 is true and S2 is false

  2. B.

    S1 is false and S2 is true

  3. C.

    S1 is true and S2 is true

  4. D.

    S1 is false and S2 is false

Attempted by 100 students.

Show answer & explanation

Correct answer: A

Answer: S1 is true and S2 is false.

  • Why S1 is true: In a write-through L1 cache every write is forwarded to L2 (and/or memory) immediately, so L1 does not retain dirty lines. Therefore, a read miss in L1 cannot cause a writeback of a dirty line from L1 to L2.

  • Why S2 is false: The statement asserts a mandatory pairing of allocation policy and write policy, but that is not correct. Typical conventions are: write-back is often paired with write-allocate (so writes allocate the block on a miss) and write-through is often paired with no-write-allocate (to avoid bringing blocks in just for a write), but these are design choices rather than strict rules.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir