首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

cache miss品种中conflict miss 和 capacity miss的区别

2013-01-01 
cache miss种类中conflict miss 和 capacity miss的区别cache miss分为3个种类:conflict misscapacitymiss

cache miss种类中conflict miss 和 capacity miss的区别
cache miss分为3个种类:
conflict miss
capacity  miss
compulsory miss 


现在搞不明白capacity miss和conflict 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.

[解决办法]
简单来说:
Compulsory misses : 首次读写时,造成的miss
Capacity misses : 此时cache已满,即超出了cache本身的能力,这时如果要读取内存数据,而此数据还没有移到cache里面,就会造成cache miss,这是比较常见的一种.
Conflict misses : 这是一种可以避免的cache miss,主要由于我们的cache替换策略不当造成的.
[解决办法]

热点排行