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

roh*_*ith 5 memory caching memory-management cpu-architecture cpu-cache

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

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

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

Joh*_*pin 5

包含是对包含缓存的内容强制执行的属性,并且与缓存的关联性无关。包含提供了消除所包含缓存的大多数窥探的好处,这允许实现以减少的标签带宽逃脱,并且还可能导致减少的窥探延迟。

Intuitively, it makes sense that when the enclosing cache has more associativity than the included cache, the contents of the included cache should always "fit" into the enclosing cache. This "static" view is an inappropriate oversimplification. Differences in replacement policy and access patterns will almost always generate cases in which lines are chosen as victim in the enclosing cache before being chosen as victim in the included cache. The inclusion policy requires that such lines be evicted from the included cache -- independent of associativity.

The case that is intuitively more problematic occurs when the enclosing cache has less associativity than the included cache. In this case it is clear that associativity conflicts in the enclosing cache will force evictions from the included cache.

In either case, judging whether the additional evictions from the included cache outweigh the benefits of inclusion is multi-dimensional. The performance impact will depend on the specific sizes, associativities, and indexing of the caches, as well as on the application access patterns. The importance of the performance impact depends on the application characteristics -- e.g., tightly-coupled parallel applications typically show throughput proportional to the worst-case performance of the participating processors, while independent applications typically show throughput proportional to the average performance of the participating processors.


Pet*_*des 3

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

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

随着外部缓存变大,您不一定会在 L1 中出现别名的行中出现别名,因此它并非无用。

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

如果您打算使外部缓存的关联性低于内部缓存,那么将其设置为 9(非包含非独占)可能是一个更好的主意。但你只是问是否可能