« All posts

Meta Cuts Ads Latency With Open-Source sched_ext Kernel Scheduler

Meta used the open-source sched_ext BPF scheduler to fix a kernel-upgrade latency regression, cutting p99 latency 28% and saving 3.28MW fleet-wide.

Upgrading from Linux kernel 6.4 to 6.9 exposed a latency regression in Meta's ads serving fleet, caused by the new EEVDF scheduler introduced in kernel 6.6. To resolve it without stalling the rollout, Meta's Ads and Kernel teams built a workload-specific scheduling policy using sched_ext, the upstream BPF-based extensible scheduler framework now part of Linux v6.12.

The custom policy soft-partitions CPUs into pools for latency-critical request-path threads versus less sensitive work, improving L3 cache locality and cutting DRAM access. The initial rollout delivered a 28% reduction in p99 latency on the ads retrieval path, 3.28 megawatts of fleet-wide power savings, and a 1.1% increase in ads ranked. Two subsequent user-space-only policy updates added a further 60% latency reduction and cut timeout errors by 18%.

Because the scheduling logic runs entirely in user space as a BPF program, updates ship in days instead of months, decoupling scheduler optimization from kernel release cycles. With sched_ext now upstream, the same mechanism is available to any operator whose workload doesn't fit general-purpose scheduling.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work