Cache Miss Types
|Miss Type||Description||Hotel Analogy|
|The first reference to a block of memory, starting with an empty cache.||The hotel is empty and the first guest has not yet arrived.|
|Capacity||The cache is not big enough to hold every block you want to use.||The hotel has no vacancies.|
|Conflict||Two blocks are mapped to the same location and there is not enough room to hold both.||A particular floor of the hotel which a guest has to stay on has all rooms occupied.|
Reducing Cache Misses
The following table summarizes the effects that increasing the given cache parameters has on each type of miss. + means there’s an improvement in the cache miss rate, 0 means no change and – means the situation gets worse.
|Miss Type||Cache Size||Block Size||Associativity|
As you increase the cache size, keeping the other two parameters constant, the number of potential compulsory misses will go up as there are more blocks to miss on in a cold cache. The limit case is a cache with a single block – you will only get one compulsory miss. Increasing the block size means more adjacent words will be fetched on each miss, so references to these words will not cause compulsory misses – this exploits spatial locality. Associativity only affects how cache blocks are arranged, not how they are fetched from main memory, so will not affect compulsory misses.
Capacity misses are not really affected by block size because the decrease in the number of blocks that can be held is offset by their increased size. Associativity has no effect on capacity misses as the total number of blocks remains the same no matter what the associativity.
Conflict misses are not affected by cache size since conflict misses arise from blocks from main memory mapping to the same position in the cache, which is mostly independent of the cache size. Increasing the block size may increase the number of conflict misses. There is a greater chance to displace a useful block from the cache.
Source : https://courses.cs.washington.edu/courses/cse378/02sp/sections/section9-2.html