Memory Hierarchy

Which describes an inclusive cache, where a lower level (such as L2) contains everything in the upper level (L1)?

  1. AUpper and lower levels never hold the same data, so total capacity is used most efficiently
  2. BThe lower cache must always be smaller than the upper one
  3. CCoherence is easier to manage, but data is duplicated
Show answer and explanation

Answer: C. Coherence is easier to manage, but data is duplicated

In an inclusive design, anything in L1 is guaranteed to be in L2, so snoops from other cores can be answered by checking L2 alone, without probing L1. The cost is duplicated data, leaving effective capacity at roughly the L2 size. Not duplicating data is the exclusive design, which uses total capacity efficiently. Lower-level caches are normally larger than upper ones.

  • A. Avoiding duplication describes an exclusive cache.
  • B. Lower-level caches are normally larger than upper ones.
  • C. Correct. Coherence is easier, but data is duplicated.
Practice this topic Back to topic

More Memory Hierarchy questions

  1. What changes when a cache is switched from direct-mapped to set-associative?
  2. In an 8-way set-associative cache, how many tags are compared in parallel on each access?
  3. In a cache with 64-byte lines and 64 sets, which set holds the data at address 0x1234?
  4. For code that writes to the same line many times, why is a write-back cache more advantageous than write-through?
  5. In contrast to LRU, which evicts the least recently used block, optimal replacement (OPT) evicts the block that will not be used for the longest time. Which statement about OPT is correct?