Experimental Patches Allow eBPF To Extend The Linux Kernel's Scheduler

Written by Michael Larabel in Linux Kernel on 30 November 2022 at 09:00 AM EST. 71 Comments
A set of "request for comments" patches posted today to the Linux kernel mailing list implement support for CPU scheduler policies to be implemented as (e)BPF programs.

The Linux kernel has seen continued adoption of (e)BPF into different areas of the kernel. One of the eBPF additions right on the horizon is the eBPF support coming to the HID subsystem for better dealing with quirky hardware in a more timely manner and hopefully leading to less redundant driver churn.

Tejun Heo announced the eBPF scheduler work today as part of the work by him and several other kernel developers. The belief is that with eBPF support for the Linux kernel scheduler it could ease experimentation and exploration of new scheduling policies, allow for application-specific schedulers and other customizable options via the loading of custom BPF programs, and provide a non-disruptive way for changing out scheduling policies within production environments.

Engineers from both Google and Meta (Facebook) are behind this initiative. As the conclusion for today's RFC patch series:
"Both Meta and Google have experimented quite a lot with schedulers in the last several years. Google has benchmarked various workloads using user space scheduling, and have achieved performance wins by trading off generality for application specific needs. At Meta, we have not yet deployed sched_ext on any production workloads, though our preliminary experiments indicate that sched_ext would provide significant performance wins when deployed at scale. If successfully upstreamed, we expect to leverage it extensively to run various experiments and develop customized schedulers for a number of critical workloads.

In closing, both Meta and Google believe that sched_ext will significantly evolve how the broader community explores the scheduling problem space, empowering continued improvement to the in-kernel scheduler, while also enabling targeted policies for custom applications. We’ll be able to experiment easier and faster, explore uncharted areas, and deploy emergency scheduler changes when necessary. The same applies to anyone who wants to work on the scheduler, including academia and specialized industries. sched_ext will push forward the state of the art when it comes to scheduling and performance in Linux."

As part of today's patches, besides working on the eBPF scheduler infrastructure there is an example scheduler that shows most scheduling decisions deferred to user-space. Another demonstration scheduler is a hybrid approach where load balancing decisions are made in user-space and that code is written in the Rust programming language.

More details on this very interesting proposal via the RFC patch series.
Related News
About The Author
Michael Larabel

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, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week