B.10 [10/10/15] Consider a two-level memory hierarchy made of L1 and L2 data cac
ID: 3726725 • Letter: B
Question
B.10 [10/10/15] Consider a two-level memory hierarchy made of L1 and L2 data caches. Assume that both caches use write-back policy on write hit and both have the same block size. List the actions taken in response to the following events:
a. [10] An L1 cache miss when the caches are organized in an inclusive hierarchy.
b. [10] An L1 cache miss when the caches are organized in an exclusive hierarchy.
c. [15] In both parts (a) and (b), consider the possibility that the evicted line might be clean or dirty.
Explanation / Answer
Answer:
Consider a two-level memory hierarchy made of L1 and L2 data caches. Assume that both caches use write-back policy on write hit and both have the same block size. List the actions taken in response to the following events:
a. An L1 cache miss when the caches are organized in an inclusive hierarchy.
1. The set indexed into on the miss must be replaced with the desired data. Therefore, the first thing that happens is that the dirt bit is checked. i. If dirty, the data is written back to L2.
2. Next, L2 is indexed into for the desired data. If the data is present, it is forwarded to the L1 cache; miss servicing is now complete.
i. If the data is not present, the dirty bit of the indexed block is checked. 1. If dirty, the data is written back to main memory.
ii. The L1 must be checked to see if it contains the cache line evicted from L2; if so, the cache line in L1 is invalidated.
iii. The desired data is then requested from main memory, written into L2, and forwarded to the L1 cache. Miss servicing is now complete.
b. An L1 cache miss when the caches are organized in an exclusive hierarchy.
1. As before, the set indexed into on the miss must be replaced with the desired data. The indexed data is written back to L2 regardless of whether it was dirty or not.
2. Next, L2 is indexed. If the data is present, it is forwarded to the L1 and invalidated in L2. Miss servicing is now complete.
i. If the data is not present, the desired data is then requested from main memory and forwarded to the L1.
c. In both parts (a) and (b), consider the possibility that the evicted line might be clean or dirty.
These cases are handled explicitly above.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.