Cache-Aware Dynamic Classification and Scheduling for Linux
Ravi Theja Gollapudi, Gokturk Yuksek, Kanad Ghose · 2019
Threads have varying needs for the on-chip caches during execution. The Completely Fair Scheduler (CFS) of Linux is oblivious to this and may make scheduling decisions that increase cache contention. Such contention is particularly pronounced in SMT (simultaneously multi-threaded or hyperthreaded) cores, and results in system throughput degradation. We present an extension to CFS, called CFS+, that detects and reduces cache contention based on the data collected from already-existing hardware instrumentation counters at run time, which is then used to dynamically determine and co-schedule threads that can share a physical core with lower cache contention. The extension evaluates cache access and performance metrics of running threads at scheduling points, and adjusts thread affinities to co-schedule them. CFS+ realizes an overall 4.56% improvement in system throughput for the applications studied, up to a 14.3% reduction of thread execution time at 70-80% core utilization, accompanied by a 2.4% overall energy savings.