Determine whether memory location is in CPU cache
问题 It is possible for an operating system to determine whether a page of memory is in DRAM or in swap; for example, simply try to access it and if a page fault occurs, it wasn't. However, is the same thing possible with CPU cache? Is there any efficient way to tell whether a given memory location has been loaded into a cache line, or to know when it does so? 回答1: In general, I don't think this is possible. It works for DRAM and the pagefile since that is an OS managed resource, cache is managed