Memory Hierarchy

Which method is effective at reducing the cache misses that occur when a program accesses data for the first time?

  1. AFetching it in advance with prefetching
  2. BDoubling the cache's associativity (number of ways)
  3. CDoubling only the cache's capacity
Show answer and explanation

Answer: A. Fetching it in advance with prefetching

Compulsory misses on first access happen because the data has never been in the cache, so more capacity or associativity does not reduce them. Prefetching data before it is needed, or using larger lines to bring in neighboring data, does. Higher associativity reduces conflict misses from competing for the same set, and more capacity reduces capacity misses from an overflowing working set.

  • A. Correct. Fetching not-yet-loaded data in advance is effective.
  • B. Higher associativity reduces conflict misses.
  • C. More capacity reduces capacity misses.
Practice this topic Back to topic

More Memory Hierarchy questions

  1. Which misses are not reduced even by making a cache fully associative?
  2. What is the effect of increasing a cache's line size?
  3. What is the main purpose of a write buffer in a write-through cache?
  4. In a write-back cache, what is the role of the dirty bit attached to each line?
  5. Which policy, on a write miss, writes directly to the lower level without loading the line into the cache?