In this blog post series, the author details the scx_rustland Linux scheduler written in Rust that runs in user-space. The project started as a fun learning experience during the holidays and aims to demonstrate that a user-space scheduler can perform as well as an in-kernel scheduler. The benefits include access to various languages and tools, while drawbacks include overhead and the need for special protection for user-space tasks. The scheduler communicates with the kernel through eBPF and sched-ext, implementing various callbacks to determine task execution order, target CPU, and time slice. The user-space component, written in Rust, implements a vruntime-based scheduling policy with a unique approach to handling interactive tasks. Overall, the project shows promising results, with future plans for development and benchmarking.
http://arighi.blogspot.com/2024/02/writing-scheduler-for-linux-in-rust.html