Skip to content

SYSTEM Cited by 1 source

sched_ext

Definition

sched_ext is an upstream, BPF-based extensible scheduling framework for the Linux kernel, officially merged in kernel v6.12. It allows scheduler developers to implement custom scheduling policies as BPF programs that the kernel invokes through event-driven callbacks (thread wake-up, enqueue, dispatch, idle transitions). The policy runs as a user-space binary that loads the BPF program into the kernel.

Architecture

sched_ext exposes a set of scheduling callbacks to BPF programs:

  • Thread wake-up: choose a CPU when a thread becomes runnable
  • Enqueue: place a thread in a run queue
  • Dispatch: select the next thread when a CPU becomes idle
  • Idle transitions: respond to CPUs entering/leaving idle states

The policy is packaged as a user-space binary that loads the BPF scheduler program. To update the policy, restart the scheduler process — no kernel rebuild or reboot required.

Origin

Co-developed by Meta and Google (authors of ghOSt) to create an extensible scheduling framework suitable for upstream Linux. ghOSt (SOSP 2021) demonstrated the value of user-space scheduling policies; sched_ext is the production-ready, upstreamed realisation.

Production deployment at Meta

Meta deployed sched_ext on its ads serving fleet to address a latency regression caused by the CFS→EEVDF transition (Linux 6.4→6.9). The custom policy soft-partitions CPUs into latency-critical and background pools, improving L3 cache locality. Results:

  • 28% p99 latency reduction (initial launch)
  • +60% additional p99 reduction (two follow-on user-space policy updates)
  • 3.28 MW power savings
  • +1.1% weighted-ads-ranked
  • 18% fewer timeout errors

(Source: sources/2026-07-13-meta-modernizing-ads-service-open-source-kernel-scheduler)

Significance

sched_ext transforms CPU scheduling from a monolithic kernel design decision into a per-workload concern iterable in days. The userspace deployment model makes scheduling optimisation available to any operator — hyperscaler, cloud provider, embedded systems team — without forking the kernel.

See also

Last updated · 585 distilled / 1,765 read