GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 53

Track dirty blocks under cache write policies

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q53 2 marks · MSQ
Report issue

Cache Memory

Question 53, GATE 2024: Two set-associative caches use LRU replacement. WBC is write-back; WTC is write-through. Which are true? A A WBC read miss never evicts a dirty block. B A WTC read miss never writes a victim block back to memory. C A WBC write hit can change a dirty bit. D A WTC write miss always writes its victim back before loading a block.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, C

Approach: Replacement policy selects the victim, whereas write policy determines whether the victim may contain newer data than main memory.
1. In a write-back cache, a write can modify the cached block without immediately updating memory. The dirty bit records this mismatch. On a write hit to a clean block, the bit can change from 0 to 1, proving C.
2. LRU selection does not guarantee a clean victim. A read miss can evict a dirty write-back block, which must then be written to memory. A's “never” is false.
3. Write-through propagates each write to memory, so a replaced cache block does not need an eviction-time dirty-block write-back in the standard completed-write model. Hence B is true.
4. D is false for the same reason. Moreover, a write-through cache may use no-write-allocate, in which case a write miss need not load a new block or select a cache victim at all.
Answer: B and C. Write-through memory traffic caused by the current write is not the same thing as writing back an evicted dirty block.

Original paper, page 33 · Answer key