CONCEPT Cited by 1 source
Workload-specific kernel scheduling¶
Definition¶
Workload-specific kernel scheduling is the practice of replacing or augmenting the kernel's general-purpose CPU scheduler with a policy that encodes domain knowledge about the application's thread structure, priority classes, and latency requirements. Instead of treating all threads as opaque entities competing for CPU time, the scheduler knows which threads are on the latency-critical request path and schedules them preferentially.
Why general-purpose schedulers leave performance on the table¶
General-purpose schedulers (Linux CFS, EEVDF) optimise for fairness across all threads with no understanding of the workload. At hyperscale, where a few milliseconds of p99 latency degradation compounds into measurable business impact, fairness is the wrong objective for the subset of threads on the critical path. Domain knowledge — "this thread is serving an ads retrieval request; that thread is a background log flusher" — is exactly what the scheduler lacks.
Enabling technology: sched_ext + BPF¶
Prior to systems/sched-ext (Linux v6.12), workload-specific scheduling required either: - Kernel patches (high cost, slow iteration, fork maintenance) - User-space scheduling (latency overhead of context switches back to user-space) - cgroup CPU controllers (coarse-grained, limited expressivity)
sched_ext solves this by allowing the scheduling policy itself to be a BPF program loaded from user space, with kernel-native callback hooks and nanosecond-scale decision making.
Production evidence¶
Meta's ads serving fleet (>5M rps) achieved a 28% p99 latency reduction + 3.28 MW power savings by encoding thread-priority knowledge into a sched_ext policy that soft-partitions CPUs into a latency-critical pool and a background pool. Two follow-on policy iterations (shipped in days as user-space restarts) added another 60% p99 reduction + 18% fewer timeouts.
(Source: sources/2026-07-13-meta-modernizing-ads-service-open-source-kernel-scheduler)
See also¶
- concepts/bpf-extensible-scheduling — the mechanism (BPF callbacks in the scheduler)
- concepts/tail-latency-at-scale — the problem workload-specific scheduling solves
- patterns/soft-cpu-partitioning-by-thread-priority — the specific technique Meta uses