About evict policy

I’m very confused with the “evict_first” in evict policy.

the description aboult “ld.cs”, as following:

Cache streaming, likely to be accessed once.

The ld.cs load cached streaming operation allocates global lines with evict-first policy in L1 and L2 to limit cache pollution by temporary streaming data that may be accessed once or twice. When ld.cs is applied to a Local window address, it performs the ld.lu operation.

I cannot understand the explanation clearly as above.

I think, the key point is “evict-first”, is there anyone would like to teach me?

The purpose of caches is to make data available faster when it is used repeatedly. Caches provide limited space. Most of the time, if a new piece of data is to be allocated in a cache, some other piece of data has to be evicted from the cache first. The question is, which entry (among available candidates) should be kicked out? This is governed by a replacement policy, e.g. the data that has been in the cache the longest, the one that has been least recently used, a random candidate, etc.

When during data streaming data is placed into a cache, this data is likely to be used just once (that is was streaming implies: there will be no re-use of this data). Marking such data “evict first” means this data is the first choice to be evicted from the cache among available candidates.

The effect of this is that it prevents the streaming data from largely filling the cache although it will likely never be used again, kicking out data one would actually like to hold onto (“cache pollution”). Instead, the same relatively few cache locations are used over and over again for the data from the stream, because each time new data from the data stream is to be allocated in the cache, the first candidate that pops up when determining which entry to evict is a previous piece of data from the stream, because it is tagged “evict me first”.

To my knowledge, this particular mechanism of classifying cache entries to efficiently deal with data streams is unique to NVIDIA GPUs; other processors offer different mechanisms to minimize cache pollution from data streaming.


thanks for your so detail explanation