News: 0001633638

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Intel's Cache Aware Scheduling Inches Closer To Being Merged For Linux

([Intel] 4 Hours Ago Cache Aware Scheduling)


I have been writing about the [1]Cache Aware Scheduling work led by Intel engineers on the Linux kernel for more than a year. I've also tested out Cache Aware Scheduling on both Intel and AMD CPUs with the patched Linux kernel to great success. And thus very happy to see the Cache Aware Scheduling patches inching closer to the mainline Linux kernel.

The Cache Aware Scheduling patches as of a few days ago were queued into Peter Zijlstra's [2]sched/cache Git branch . Hopefully soon Peter will push them into a tip/tip.git branch that would then put it in direct trajectory for merging into the next Linux kernel merge window.

Cache Aware Scheduling can help enhance Linux performance on modern CPUs with multiple cache domains. The scheduler tries to help ensure that tasks sharing data are colocated to the same last level cache (LLC) domain for ensuring better cache locality and reducing cache misses/bouncing. I've benchmarked [3]nice performance gains on AMD EPYC and [4]better Xeon 6 performance too . Once Cache Aware Scheduling is merged or about to hit the finish line, I'll be through with some fresh benchmarks.

Beyond those patches now hitting Peter's development Git branch, [5]a new patch series from Intel engineer Tim Chen were sent out on Wednesday that now consist of just enhancements atop those patches staged in that Git branch.

The new enhancement patch series resolves an over-aggregation issue that could occur with the Cache Aware Scheduling behavior. Plus there are also various bug fixes thanks to [6]the AI-based reporting by Sashiko .

Tim Chen noted on the patch cover letter:

"Compared with cache-aware v4, the major change in the first part is storing the LLC effective size in the per-CPU bottom sched_domain. This allows checking whether a task's memory footprint exceeds the threshold by fetching the value directly from the corresponding sched_domain, instead of recalculating it every time. Besides, the NUMA balance page-fault statistics is used instead of RSS to estimate the working set. We also picked up Jianyong's optimization patch to reduce CPU scan overhead. However, if NUMA balancing is not enabled we will not have this working set estimate. Perhaps using RSS will be apprpriate for such scenario.

...

Test results show that the current version keeps the same performance as v4 for workloads and platforms we tested.

Future plans are to introduce fine-grained control of using cache aware scheduling on specific tasks after the load-balance-based cache-aware scheduling is merged:

- Look into task tagging (e.g. with schedqos framework, cgroup) for non process based tasks grouping to LLC.

- Evaluate fast cache-aware aggregation in the wakeup path."

Great to see yet more improvements to Cache Aware Scheduling on the way and hopefully it will soon make its way to the mainline Linux kernel.



[1] https://www.phoronix.com/search/Cache+Aware+Scheduling

[2] https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=sched/cache

[3] https://www.phoronix.com/review/cache-aware-scheduling-amd-turin

[4] https://www.phoronix.com/review/intel-xeon-6-cache-sched

[5] https://lore.kernel.org/all/cover.1778703694.git.tim.c.chen@linux.intel.com/

[6] https://www.phoronix.com/news/Sashiko-Linux-AI-Code-Review



Brief History Of Linux (#13)
Wanted: Eunuchs programmers

Everything you know about the creation of the Unix operating system is
wrong. We have uncovered the truth: Unix was a conspiracy hatched by
Ritchie and Thompson to thwart the AT&T monopoly that they worked for. The
system, code-named EUNUCHS (Electronic UNtrustworthy User-Condemning
Horrible System), was horribly conceived, just as they had planned.

The OS, quickly renamed to a more respectable "Unix", was adopted first by
Ma Bell's Patent Department and then by the rest of the monopoly. AT&T saw
an inexpensive, multi-user, portable operating system that it had all
rights to; the authors, however, saw a horrible, multi-crashing system
that the Evil Ma Bell Empire would become hopelessly dependent on. AT&T
would go bankrupt trying to maintain the system and eventually collapse.

That didn't happen. Ritchie and Thompson were too talented to create a
crappy operating system; no matter how hard they tried the system was too
good. Their last ditch effort to sabotage the system by recoding it
obfuscated C was unsuccessful. Before long Unix spread outside of Bell
Labs and their conspiracy collapsed.