[10/10/15] Consider a two-level memory hierarchy made of Ll and L2 data caches.
ID: 3715929 • Letter: #
Question
[10/10/15] Consider a two-level memory hierarchy made of Ll 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: [10] An L1 cache miss when the caches are organized in an inclusive hierarchy. a. b. [10] An Ll cache miss when the caches are organized in an exclusive hierarchy. [15] In both parts (a) and (b), consider the possibility that the evicted line might be clean or dirty. c.Explanation / Answer
Solution :
a)
Inclusive cache : When a block present in L1 is also present in L2 then it is called inclusive cache.
Here when L1 cache miss occurs following action is taken :
- Check if block is in L2 cache or not.
- If block is in L2 cache then copy it to L1 cache and it is used by processor.
- If block is not In L2 cache then block is brought from Main memory to L1 and L2 both and then it is used by proessor.
- In above procesure if any other block has to be evicted from L1 then it will be removed from L1 and new block will be brought to L1.
- If any other block has to be evicted from L2 to bring new block from Main memory then same block is evicted from L1 too(if it is present in L1).
-------------------------------------------------
b)
Exclusive cache : When a block is present in any of L1 or L2 then it is exclusive policy.
Here when L1 cache miss occurs following action is taken :
- Check if block is present in L2 or not.
- If it is present in L2 cache then move it to L1 cache and use it.
- If it is not present in L2 cache then bring block from Main memory to L1 cache (and not in both) and use it.
- If eviction has to take place in L1 then remove the block from L1 and place it into L2 cache.
- Here L2 cache has all victim blocks.
If you have any doubts then you can ask in comment section. If you find solution helpful then you can upvote the answer. Thank you.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.