Part 6
2 chapters
Schedulers (sched_ext)
Write real CPU schedulers in BPF with sched_ext / struct_ops, from a minimal policy to a more realistic one.
Chapter 43
Writing a scheduler: sched_ext and struct_ops
A new kind of BPF program: implementing a CPU scheduler with sched_ext and the struct_ops model. Walk the minimal scx_simple scheduler's callbacks, understand dispatch queues and the safety watchdog, then run the real scheduler and watch it work with an Aya tracing probe.
Chapter 44
A realistic policy: keeping work on warm cores
Move past the minimal scheduler to a real strategy. The scx_nest policy concentrates work on a small set of warm, high-frequency cores instead of spreading it thin โ express it through CPU selection and a nest of cores, run the real scheduler, and watch the concentration appear with an Aya per-CPU busy probe.