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

挨踢民工的乐章 2012-11-06 11:01:40
cache miss分为3个种类:
conflict miss
capacity miss
compulsory miss


现在搞不明白capacity miss和conflict miss 有啥区别?谁能举个例子?
...全文
1750 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
ituling 2015-01-10
  • 打赏
  • 举报
回复
是这个样子的 conflict miss capacity miss compulsory miss conflict miss conflict miss是因为冲突,比如hash冲突,引起的,需要替换一个cache行,这叫冲突,因为容量不够,导致了冲突。 capacity miss 是被替换过得cache行又一次被访问,因为替换出去了,所以引起了缺失,这叫容量缺失。 compulsory miss 冷缺失,就是第一次访问的时候,没有在cache里面,引起的缺失, 是无法避免的。
  • 打赏
  • 举报
回复
引用 7 楼 liaokz 的回复:
对于这个问题,本人也不是很清楚,但是查阅相关资料,得知:1、强制缺失与Cache大小和相连度无关,只与行大小有关;2、容量缺失只发生在全相联中;3、冲突缺失发生在全相联、组相联、直接映射中。 因此是否可以理解为:1、只有全相联中,Cache满了后,发生的缺失,才叫容量缺失(同时,如果第一次读入某Block,也记一次强制缺失;这个缺失同时也看成是一次冲突缺失——即全相……
还是感觉不到容量和冲突到区别,只是感觉一个冲突就够了
liaokz 2012-12-01
  • 打赏
  • 举报
回复
对于这个问题,本人也不是很清楚,但是查阅相关资料,得知:1、强制缺失与Cache大小和相连度无关,只与行大小有关;2、容量缺失只发生在全相联中;3、冲突缺失发生在全相联、组相联、直接映射中。 因此是否可以理解为:1、只有全相联中,Cache满了后,发生的缺失,才叫容量缺失(同时,如果第一次读入某Block,也记一次强制缺失;这个缺失同时也看成是一次冲突缺失——即全相联中,冲突缺失与容量缺失相同) 2、在组相联和直接映射中,发生的冲突,都叫冲突缺失;同时,如果第一次读入某Block,也记一次强制缺失; 是否有高人指点下?
whizer 2012-11-07
  • 打赏
  • 举报
回复
引用 4 楼 benben2301 的回复:
引用 3 楼 whizer 的回复: 简单来说: Compulsory misses : 首次读写时,造成的miss Capacity misses : 此时cache已满,即超出了cache本身的能力,这时如果要读取内存数据,而此数据还没有移到cache里面,就会造成cache miss,这是比较常见的一种. Conflict misses : 这是一种可以避免的cache miss,主……
举例来说: 系统运行一段时间后,cache还没有满,即cache中还有空间,此时系统如果想要读取一块内存,如果我们采用直接相连的map原则,发现此内存在cache中的位置已经有内容了,那么此时就需要把这块cache替换出去,但是如果我们采用全相连map原则,或者组相连map原则就可能找到空闲的cache块,而不需要进行替换操作.这就是con miss,而不是cap miss.
  • 打赏
  • 举报
回复
引用 5 楼 whizer 的回复:
引用 4 楼 benben2301 的回复:引用 3 楼 whizer 的回复: 简单来说: Compulsory misses : 首次读写时,造成的miss Capacity misses : 此时cache已满,即超出了cache本身的能力,这时如果要读取内存数据,而此数据还没有移到cache里面,就会造成cache miss,这是比较常见的一种. Conf……
cap misses和 conf misses 应该是包含关心,conf 包含 cap。 但你举得例子明显有漏洞:在全相联模式下,如果某数据、代码块B1需要加载到cache,如果此时cache有空闲行(没被用过的),现在应该是compulsory miss。如果是conf miss,显然现在不可能有空闲行(如果有空白块的话他第一次加载之后也不可能被替换出去)。现在conf miss和 cap miss 还有什么区别?
  • 打赏
  • 举报
回复
引用 3 楼 whizer 的回复:
简单来说: Compulsory misses : 首次读写时,造成的miss Capacity misses : 此时cache已满,即超出了cache本身的能力,这时如果要读取内存数据,而此数据还没有移到cache里面,就会造成cache miss,这是比较常见的一种. Conflict misses : 这是一种可以避免的cache miss,主要由于我们的c……
不是很明白capacity missses 和Conflict Misses的区别。能否举个例子是con miss 不是 cap miss的?
whizer 2012-11-06
  • 打赏
  • 举报
回复
简单来说: Compulsory misses : 首次读写时,造成的miss Capacity misses : 此时cache已满,即超出了cache本身的能力,这时如果要读取内存数据,而此数据还没有移到cache里面,就会造成cache miss,这是比较常见的一种. Conflict misses : 这是一种可以避免的cache miss,主要由于我们的cache替换策略不当造成的.
whizer 2012-11-06
  • 打赏
  • 举报
回复
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.
  • 打赏
  • 举报
回复
这有人回复下不?

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧