简体   繁体   中英

How to clear CPU cached owned by a process in Linux x86

我想获得内核API,这些API可用于刷新/清除特定进程拥有的CPU缓存。

There's no such thing as "CPU cache owned by a process".

The CPU / memory controller manages the cache, not the OS.

On some CPU architectures (I don't know!) it might be possible to explicitly instruct the caches to evoke ("invalidate") certain cache lines, but that's probably more along the lines of pretty specific DMA controller commands than a Linux API thing.

I think your question might be born from a superficial understanding of Meltdown/Spectre. If that's the case: re-read the original papers and read up on x86 CPU cache implementations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM