较低级别的缓存是否可以具有较高的关联性,并且仍然保持包含性? [英] Can a lower level cache have higher associativity and still hold inclusion?

查看:147
本文介绍了较低级别的缓存是否可以具有较高的关联性,并且仍然保持包含性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

较低级别的缓存是否可以具有较高的关联性,并且仍然保持包含性?

假设我们有2级缓存(L1最接近CPU,L2最接近主存储器) L1高速缓存是与4组关联的2路集,假设L2高速缓存直接映射有16个高速缓存行,并假定两个高速缓存具有相同的块大小.然后,我认为即使L1(较低级别)具有比L2(较高级别)更高的关联性,它也将遵循包含属性.

根据我的理解,较低级别的缓存可以具有较高的关联性(并且仍然保持包含).这只会更改标记位的数量(如在每个级别的物理地址中所示),比较器的数量和要使用的MUX.请告诉我这是否正确.

解决方案

是的,但是外部缓存中的冲突逐出可能会强制从内部缓存中逐出,以保持包容性.

(我认为,如果两个缓存都使用简单的索引,那么使用更大且至少具有关联性的外部缓存就不会拥有这种索引,因为只有当您在内部也使用别名时,外部缓存中的别名才会发生.)

随着外部缓存变大,您不一定会在其中会在L1中出现别名的行中得到别名,所以它并不是没有用的.

但这是不寻常的:与内部缓存相比,外部缓存通常更大,并且的关联性更高,因为它们不必那么快,并且高命中率更有价值.

如果要使外部高速缓存的关联性小于内部高速缓存的关联性,则将其设置为NINE(非包含非包含)可能是一个更好的主意.但是您只问它是否可能.

Can a lower level cache have higher associativity and still hold inclusion?

Suppose we have 2-level of cache.(L1 being nearest to CPU and L2 being nearest to main memory) L1 cache is 2-way set associative with 4 sets and let's say L2 cache is direct mapped with 16 cache lines and assume that both caches have same block size. Then I think it will follow inclusion property even though L1(lower level) has higher associativity than L2 (upper level).

As per my understanding, lower level cache can have higher associativity (and still hold inclusion). This will only change the number of tag bits (as seen in physical address at each level), number of comparators and MUX to be used.Please let me know if this is correct.

解决方案

Yes, but conflict evictions in the outer cache may force eviction from the inner cache to maintain inclusivity.

(I think if both caches use simple indexing, you wouldn't have that with an outer cache that's larger and at least as associative, because aliasing in the outer cache would only happen when you also alias in the inner.)

With the outer cache being larger you don't necessarily get aliasing in it for lines that would alias in L1, so it's not useless.

But it is unusual: usually outer caches are larger and more associative than inner caches because they don't have to be as fast, and high hit rate is more valuable.

If you were going to make the outer cache less associative than an inner cache, making it NINE (non-inclusive non-exclusive) might be a better idea. But you only asked if it was possible.

这篇关于较低级别的缓存是否可以具有较高的关联性,并且仍然保持包含性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆