Memory Hierarchy
Which method is effective at reducing the cache misses that occur when a program accesses data for the first time?
- AFetching it in advance with prefetching
- BDoubling the cache's associativity (number of ways)
- 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.