Optimizing Task Latency by Controlling CPU Caching in Schedulers
Every time the Linux scheduler migrates your task to another core, it silently hands you a latency bill. The working set your task built up in L1 and L2 — accumulated over milliseconds of careful execution — evaporates the moment the CPU changes. The task resumes on the new core cold, refetching data from L3 or main memory for the next few hundred microseconds. On a busy 32-core server this happens thousands of times per second, invisibly, and it is frequently the actual reason your p99 latency looks nothing like your median.


