Research notes

How real operating systems schedule

The classroom algorithms are the foundation. These notes cover how production kernels build on them, plus a few papers worth reading.

Linux CFS / EEVDF
General purpose

The Completely Fair Scheduler models an idealized multitasking CPU using a red-black tree keyed on virtual runtime (vruntime). Each task accrues vruntime proportional to its weight; the scheduler always picks the task with the smallest vruntime. As of kernel 6.6 it transitions to EEVDF (Earliest Eligible Virtual Deadline First), adding latency-sensitivity via per-task deadlines.

O(log n) pick via RB-treeWeight from nice valuesNo fixed time slices
Windows Scheduler
Priority + boost

Windows uses 32 priority levels across two classes (real-time 16–31, variable 1–15) with per-CPU ready queues. It applies priority boosts on I/O completion, foreground focus, and starvation avoidance (the balance-set manager boosts starved threads), then decays them after a quantum.

32 priority levelsMultilevel feedbackAnti-starvation boosting
Real-Time: RMS & EDF
Hard deadlines

Rate Monotonic Scheduling assigns static priorities by period (shorter period → higher priority) and is optimal among fixed-priority policies, with the Liu & Layland bound U ≤ n(2^(1/n) − 1). EDF is dynamic-priority and optimal up to U ≤ 1, but degrades unpredictably under overload.

RMS: static, U ≤ ln 2 ≈ 0.69EDF: dynamic, U ≤ 1Schedulability analysis
Multiprocessor & NUMA
Scaling

Modern schedulers balance load across cores while respecting cache affinity and NUMA locality. Techniques include per-CPU run queues with periodic load balancing, gang scheduling for parallel jobs, and energy-aware placement on heterogeneous (big.LITTLE) architectures.

Cache/NUMA affinityLoad balancingEnergy-aware (EAS)

Papers worth reading

Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment

Foundational RMS/EDF optimality results and the utilization bound.

Liu & Layland, 1973

The Linux Scheduler: a Decade of Wasted Cores

Identifies subtle load-balancing bugs leaving cores idle despite runnable work.

Lozi et al., EuroSys 2016

Lottery Scheduling: Flexible Proportional-Share Resource Management

Randomized proportional-share scheduling via ticket allocation.

Waldspurger & Weihl, OSDI 1994

An Experimental Time-Sharing System

Describes CTSS, whose multilevel scheduling is the origin of the multilevel feedback queue.

Corbató, Merwin-Daggett & Daley, 1962