是这个样子的
conflict miss
capacity miss
compulsory miss
conflict miss
conflict miss是因为冲突,比如hash冲突,引起的,需要替换一个cache行,这叫冲突,因为容量不够,导致了冲突。
capacity miss 是被替换过得cache行又一次被访问,因为替换出去了,所以引起了缺失,这叫容量缺失。
compulsory miss 冷缺失,就是第一次访问的时候,没有在cache里面,引起的缺失, 是无法避免的。
cap misses和 conf misses 应该是包含关心,conf 包含 cap。
但你举得例子明显有漏洞:在全相联模式下,如果某数据、代码块B1需要加载到cache,如果此时cache有空闲行(没被用过的),现在应该是compulsory miss。如果是conf miss,显然现在不可能有空闲行(如果有空白块的话他第一次加载之后也不可能被替换出去)。现在conf miss和 cap miss 还有什么区别?
Compulsory misses are those misses caused by the first reference to a location in memory. Cache size and associativity make no difference to the number of compulsory misses. Prefetching can help here, as can larger cache block sizes (which are a form of prefetching). Compulsory misses are sometimes referred to as cold misses.
Capacity misses are those misses that occur regardless of associativity or block size, solely due to the finite size of the cache. The curve of capacity miss rate versus cache size gives some measure of the temporal locality of a particular reference stream. Note that there is no useful notion of a cache being "full" or "empty" or "near capacity": CPU caches almost always have nearly every line filled with a copy of some line in main memory, and nearly every allocation of a new line requires the eviction of an old line.
Conflict misses are those misses that could have been avoided, had the cache not evicted an entry earlier. Conflict misses can be further broken down into mapping misses, that are unavoidable given a particular amount of associativity, and replacement misses, which are due to the particular victim choice of the replacement policy.