Svashasan Logo
Simulated data

Operating Systems and Embedded Software · Kernel

Process Scheduling

Also known as CPU scheduling, task scheduling, scheduler, EEVDF, CFS

IntermediateSource-checked · awaiting technical reviewLast reviewed 6 December 2026

The operating-system function that decides which runnable thread uses each CPU and for how long, balancing fairness, throughput, responsiveness and timing guarantees according to scheduling policies and priorities.

Explanation

A scheduler keeps track of runnable threads and picks one per CPU whenever the running thread blocks, uses up its time slice or is preempted by a higher-priority thread. It also balances load across cores and accounts for CPU time.

Linux provides normal policies (SCHED_OTHER, SCHED_BATCH, SCHED_IDLE), handled by a fair scheduler, and real-time policies. Since kernel 6.6 the fair scheduler has been moving from the Completely Fair Scheduler (CFS) to EEVDF (Earliest Eligible Virtual Deadline First), which still aims to share CPU time equally among runnable tasks of the same priority. Real-time threads (SCHED_FIFO and SCHED_RR, static priorities 1 to 99) always take precedence over normal threads, and SCHED_DEADLINE schedules tasks by explicit runtime, deadline and period parameters.

Policy choice matters when infotainment, logging and control-related threads share an SoC. A misconfigured real-time thread can starve system services, which is why Linux can cap the CPU bandwidth available to real-time groups.

How it works

Each CPU keeps run queues per scheduling class. At every scheduling point, a runnable real-time thread is always chosen before normal threads. Among normal threads, EEVDF tracks each task's virtual runtime and lag (how much CPU time it is owed) and picks an eligible task with the earliest virtual deadline. A context switch then saves the current thread's registers and restores the next thread's.

Automotive applications

  • Prioritising audio and display threads in infotainment
  • Pinning control threads to dedicated cores
  • Running background logging at low priority
  • CPU sharing between containers through cgroups

Example

On a cockpit SoC, the audio pipeline thread runs as SCHED_FIFO priority 70 so normal-priority work cannot delay playback. The HMI uses normal priority with a lower nice value, and a crash-report uploader runs as SCHED_IDLE so it only uses otherwise idle CPU time.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. sched(7): overview of CPU scheduling (opens in a new tab)

    Linux man-pages project (man7.org) · Project documentation · Scheduling policies · retrieved 6 December 2026

    “As the numbers imply, real-time threads always have higher priority than normal threads.”
  2. EEVDF Scheduler (opens in a new tab)

    The Linux Kernel documentation (kernel.org) · Project documentation · retrieved 6 December 2026

    “Similarly to CFS, EEVDF aims to distribute CPU time equally among all runnable tasks with the same priority.”
  3. Real-Time group scheduling (opens in a new tab)

    The Linux Kernel documentation (kernel.org) · Project documentation · 1. Overview · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.