53 53 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? $S_1$ is true and $S_2$ is false $S_1$ is false and $S_2$ is true $S_1$ is true and $S_2$ is true $S_1$ is false and $S_2$ is false CO & Architecture gatecse-2021-set2 co-and-architecture cache-memory two-marks + – Arjun 19.0k views answer comment Share Follow Print See all 17 Comments 17 17 Comments reply Show 14 previous comments Taniii commented Jun 19 reply Follow flag we can use any combination but typically (to make most of usage) write through is used with no write allocate and write back is used with write allocate 1 1 replyShare duckduck commented Jul 23 reply Follow flag @Taniii ur right 0 0 replyShare Raj_Dev_Verma commented Aug 19 reply Follow flag S1 is true, S2 is false 0 0 replyShare Please log in or register to add a comment.
Best answer 52 52 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 Arjun answered Jun 13, 2021 • selected Jun 13, 2021 by gatecse Arjun comment Share Follow See all 5 Comments 5 5 Comments reply Show 2 previous comments Godlike commented Jan 1, 2023 reply Follow flag because the word “must” is used. S2 would be true if “may” or “can” was used in place of “must” 2 2 replyShare khushitshah commented Jan 23, 2023 i edited by khushitshah Jan 23, 2023 reply Follow flag @Sachin Mittal 1 @GO Classes sir, here I don’t understand how can we say for sure that read miss on L1 will never initiate write back in L2? Scenario:We write to a block which is not in L1 but in L2, this block will have the dirty bit set. now, read from a block which is not in L1 or L2, assume that maps to same block as the block we wrote to earlier, this is initiate write back in L2.. What am I missing? I missinterpreted the question S1 is talking about L1 to L2 writebacks and not L2 to memory writebacks 1 1 replyShare Ananthu_Vignesh commented 4 days ago reply Follow flag same bro, i read "to" as "of". 0 0 replyShare Please log in or register to add a comment.
8 8 votes 1) Core concepts (root)Write-through vs write-backWrite-through: every store updates the level-1 cache and is immediately forwarded to the next level (L2/main memory). Because writes propagate on every store, L1 lines do not become “dirty” (there’s no need for a dirty bit in L1 for the written word), so an evicted L1 line does not normally need to be written back to L2 — L2 already has the up-to-date value. Write-back: stores update only the L1 cache line and mark it dirty. The updated data is written to L2 only when the dirty line is evicted from L1. Thus L1 can cause writebacks to L2 on eviction. Read-miss behavior in an inclusive two-level hierarchyOn an L1 read miss, the block is fetched from L2 into L1 (read-allocate) if the policy fetches on read miss. Whether this causes any writeback from L1→L2 depends on whether the L1 line being replaced was dirty (i.e., modified in L1 but not yet pushed to L2). In a write-through L1 the replaced line will not be dirty (since all writes were forwarded), so no L1→L2 writeback is needed when bringing the miss block in. Write-allocate vs no-write-allocate (on write miss)Write-allocate (fetch-on-write): on a write miss the cache allocates (loads) the block into the cache and then performs the write there.No-write-allocate (write-no-allocate / write-around): on a write miss the cache does not allocate; the write is sent directly to the next level (L2 / memory) without bringing the block into L1.These write-miss policies are independent mechanisms from the choice of write-through/write-back; architects often pair write-through with no-write-allocate and write-back with write-allocate as common choices, but they are not logically forced to each other. The word “must” in S2S_2S2 makes the statement too strong. 2) Apply to the statementsS1: “Read misses in a write-through L1 cache do not result in writebacks of dirty lines to the L2.”Because a write-through L1 forwards writes to L2 immediately, L1 lines are not held dirty — so when you bring a new block into L1 on a read miss and must evict some L1 line, that evicted line does not require a writeback to L2.Therefore S1S_1S1 is true. S2: “Write allocate policy must be used in conjunction with write-through caches and no-write-allocate policy is used with writeback caches.”Common practice pairs (write-through → no-write-allocate) and (write-back → write-allocate), but these are design choices, not hard requirements. Both write-through and write-back caches can be configured with either write-allocate or no-write-allocate depending on workload and design trade-offs. Because S2S_2S2 uses the word “must”, it is false. (If it had said “is usually paired with” it would be acceptable; but as a categorical “must” it is incorrect.) Patel_And_Patel answered Dec 11, 2025 Patel_And_Patel comment Share Follow See 1 comment 1 1 comment reply AnsuNanda commented Sep 27 reply Follow flag This answer needs to be tagged as useful answer. Thank you patel bhai 0 0 replyShare Please log in or register to add a comment.
4 4 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. Yashvir answered Apr 8, 2021 Yashvir comment Share Follow 0 reply Please log in or register to add a comment.