Process Scheduling

Criteria of a good scheduling algorithm

Scheduling algorithms  http://pages.cs.wisc.edu/~remzi/OSTEP/cpu-sched.pdf

Real-world schedulers

https://www.usenix.org/conference/atc18/presentation/bouron

https://www.ibm.com/developerworks/linux/library/l-completely-fair-scheduler/

The Linux O(1) Scheduler

Structure overview:

O(1) cost

The problem: interactive tasks vs. batch tasks

O(1) scheduler's solution

However, the "rocket science" is very complicated and error-prone.

The Linux CFS Scheduler

A single queue, sorted by the "virtual runtime", maintained in a Red-black tree.

After using some CPU time, a task is pushed to its right as its virtual runtime increases

The task with the minimum runtime is picked up for running.

Details: https://www.kernel.org/doc/html/latest/scheduler/sched-design-CFS.html