CFS
also: Completely Fair Scheduler
CFS (Completely Fair Scheduler) is the default Linux kernel process scheduler that allocates CPU time fairly among running processes using a red-black tree data structure to track and balance execution time.
The Completely Fair Scheduler replaced the O(1) scheduler in Linux 2.6.23 and became the standard CPU scheduler for the mainline kernel. It operates on the principle of fairness—ensuring that each runnable process receives a proportional share of CPU time based on its priority and scheduling class.
CFS maintains a virtual clock that tracks how much CPU time each process has consumed. Processes that have used less CPU time receive higher priority to run next, creating a balanced, "completely fair" distribution. This approach eliminates starvation and provides better interactive response compared to older schedulers.
For example, if two processes of equal priority are running, CFS ensures both receive approximately 50% of the CPU. If one process uses less time (perhaps due to I/O operations), it gets scheduled sooner to catch up. You can observe CFS behavior through tools like top, ps, or by reading /proc/sched_debug.