Abstract
In previous RustLab editions, we showed how to build a working Linux kernel scheduler in user space with Rust, using a C-based BPF layer to channel scheduling events between the kernel and the user-space Rust scheduler.
`scx_reevdf` takes a step further, bringing Rust directly into the kernel's scheduling path: both its user-space loader and BPF scheduler are written in Rust. Scheduling decisions happen in the kernel, with no C BPF source layer or round trips to a user-space scheduler for each scheduling event.
Built on `sched_ext`, the project re-implements the Linux EEVDF (Eligible Earliest Virtual Deadline First) fair scheduler entirely in Rust, allowing it to safely replace the in-kernel scheduler at runtime without the risk of crashing the system.
Task contexts, scheduling queues and topology information all live in BPF arena memory and the same Rust abstractions can be used to access these structures from both the kernel and user space, without any translation layer, message-passing protocol, or memory copying.
The talk will show what it takes to compile Rust for BPF, how to reproduce Linux's EEVDF fair scheduling behavior, and how this implementation performs against the default kernel scheduler written in C.