Skip to content
Official PYQ · 2021

GATE CS 2021 Set 2 Q27 — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI

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

  • S1S_1: Read misses in a write through L1L1 cache do not result in writebacks of dirty lines to the L2L2
  • S2S_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?

Choose one option
View worked solution

Answer: A

Let us analyze the two statements individually:

Statement S1S_1: True

  • In a write-through L1L1 cache, every write operation updates both the L1L1 cache and the next level (L2L2 cache) simultaneously.
  • Because of this, the data in L1L1 is always consistent with L2L2, meaning L1L1 never contains any "dirty" lines (lines modified in L1L1 but not updated in L2L2).
  • When a read miss occurs in L1L1, a line may need to be evicted to make room for the new line. Since there are no dirty lines in L1L1, no writeback to L2L2 is ever required.

Statement S2S_2: 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 L1L1 on a write miss unnecessary.
  • The statement asserts the exact opposite and claims it "must" be used, which is incorrect.

Thus, S1S_1 is true and S2S_2 is false.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Hierarchy: Cache, Main Memory and Secondary Storage questions