Skip to content

Scheduler

How Linux decides which task runs next

The Linux scheduler is responsible for deciding which task runs on each CPU at any given moment. It balances competing requirements: fairness between tasks, low latency for interactive work, high throughput for batch jobs, and determinism for real-time processes.

Structure of this section

Fundamentals

Lifecycle

Real-Time

Resource Control

Topology

Debugging

Key source files

File What it does
kernel/sched/core.c __schedule(), context_switch(), wake_up_process()
kernel/sched/fair.c CFS and EEVDF implementation
kernel/sched/rt.c RT scheduler
kernel/sched/deadline.c SCHED_DEADLINE
kernel/sched/sched.h Core data structures: struct rq, struct sched_class, struct cfs_rq
include/linux/sched.h struct task_struct, struct sched_entity