Customizing a Low-Latency CPU Scheduler with sched_ext
- Time
- 2026-08-09 10:50 ~ 11:20
- Speaker
- 許育瑋
- Room
- TR213
- Co-write
Abstract
"Why did my game just stutter again?" The answer is often not insufficient CPU power, but a scheduler distributing compute resources to background tasks the gamer doesn't care about. Linux's EEVDF scheduler optimizes primarily for fairness and estimates load via EWMA. However, fairness does not equal a smooth user experience, and EWMA only captures short-term fluctuations, leaving latency-sensitive workloads with unstable behavior. scx_teddy is a gaming-focused, machine-learning-based CPU scheduler built on sched_ext (SCX), introduced in Linux v6.12+. Rather than requiring users to manually mark important tasks, it lets the system itself identify which threads are critical to gameplay smoothness and which are merely background tasks that can step aside, then adjusts scheduling decisions according to the gamer's expectations. The system observes per-task behavioral features (runtime, sleep ratio, iowait, etc.) in the Linux kernel over long time windows, then performs unsupervised K-means clustering in user space. Once tasks are classified, scx_teddy applies a cluster policy designed for gaming scenarios, dynamically adjusting priority, time slice, and whether a cluster gets exclusive access to performance cores. This talk presents the design and implementation of scx_teddy, including:
- Why ML over rule-based classification
- Trade-offs in feature engineering and behavioral metrics
- Data pipeline design between eBPF and user space
- Comparison and experimental results against existing SCX schedulers such as scx_cake
The goal is not to chase higher benchmark scores, but to let the system genuinely understand which tasks affect what the player feels — and which don't deserve to preempt the game.
Speaker
許育瑋
Ave Mujica 演唱會抽到票了,真是奇蹟
21 歲,是個學生
修了 Linux 核心設計之後踏上了探索系統軟體的旅途。 之前把系上必修課做的奇怪「微電腦」搬到 SITCON Demo 展出,最近在研究 SCX 和複習統計學。
GitHub: weiso131