
Skandh Gupta started this conversation 5 months ago.
On Skylake (SKL) why are there L2 writebacks in a read-only workload that exceeds the L3 size?
On Skylake (SKL) processors, why are there L2 writebacks in a read-only workload that exceeds the L3 cache size?
codecool
Posted 5 months ago
On Skylake processors, the L2 cache is inclusive, meaning that data in the L1 and L2 caches is also present in the L3 cache. However, the L3 cache is a non-inclusive victim cache, which means that when data is evicted from the L2 cache, it can either be moved to the L3 cache or written back to memory, depending on certain heuristics1.
In a read-only workload that exceeds the L3 cache size, the L2 cache may still perform writebacks to memory for several reasons:
Cache Eviction Policies: When the L2 cache is full and needs to evict data, it may choose to write back modified (dirty) cache lines to memory instead of moving them to the L3 cache, especially if the data is not expected to be reused soon.
Non-Inclusive L3 Cache: Since the L3 cache is non-inclusive, evicted data from the L2 cache does not necessarily get stored in the L3 cache. Instead, it may be written back to memory directly1.
Workload Characteristics: The specific characteristics of the read-only workload, such as the access patterns and data locality, can influence the cache behavior and lead to more frequent writebacks from the L2 cache.
These factors contribute to the presence of L2 writebacks in a read-only workload that exceeds the L3 cache size on Skylake processors.