Implementing a BPF Extensible Scheduler with sched_ext
Prerequisites
Part I — The Scheduler You Never Got to Touch
The Linux scheduler has always been a black box you configure around, not something you replace. CFS gives you nice values, cgroup weights, and CPU affinity — but the actual scheduling policy, the decision about which task runs next on which CPU, has been kernel-only territory since the beginning. That changed with Linux 6.12.
sched_ext (BPF extensible scheduler) lets you implement a custom scheduling class in BPF. Not a hint. Not a tunable. The actual policy — which task gets the CPU, for how long, on which core. You write BPF programs that the kernel calls at every scheduling decision point. If your BPF program crashes, the kernel falls back to CFS automatically. No reboot, no panic.



