Early Patches Bring BPF To The Linux Scheduler
Written by Michael Larabel in Linux Kernel on 16 September 2021 at 12:00 AM EDT. 1 Comment
LINUX KERNEL --
The latest area where BPF is looking to expand within the Linux kernel is its CFS scheduler.

Roman Gushchin of Facebook published an initial patch series for providing initial BPF support within the Linux CFS scheduler as a way for external code to safely alter select kernel decisions.

Roman noted in the patch series,"This leads to BPF hooks, which have been successfully used in various kernel subsystems to provide a way for external code to (safely) change a few kernel decisions. BPF tooling makes this pretty easy to do, and the people deploying BPF scripts are already quite used to updating them for new kernel versions. This patchset aims to start a discussion about potential applications of BPF to the scheduler. It also aims to land some very basic BPF infrastructure necessary to add new BPF hooks to the scheduler, a minimal set of useful helpers, corresponding libbpf changes, etc."

With BPF support in the Linux kernel scheduler among the possibilities being talked about are better catering scheduling policies depending upon the workload, better preemption handling, and experimenting with different policies in production settings.

Facebook's work so far with BPF for the scheduler is proving beneficial, "We're at a very early stage, however already have seen a nice latency and ~1% RPS wins for our (Facebook's) main web workload."

More details for those interested on the BPF mailing list.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week