Meta's Ads and Linux Kernel teams used sched_ext — the BPF-based extensible scheduler merged in Linux v6.12 — to build a workload-specific scheduling policy for their ads serving fleet. When upgrading to kernel v6.9, the new EEVDF scheduler caused latency regressions, blocking part of the fleet on the older v6.4 kernel. By implementing a custom BPF scheduler that soft-partitions CPUs into latency-critical and background pools with dynamic load-based sizing, they achieved a 28% reduction in p99 latency on the ads retrieval path, 3.28 MW of power savings, and a 1.1% increase in ads ranked. Follow-on user-space-only policy updates added a further 60% p99 latency reduction and 18% fewer timeout errors. Because the scheduler policy lives in user space as a BPF program, iterations ship in days rather than months, turning sched_ext into a continuous optimization platform independent of kernel release cycles.
Table of contents
TL; DRWhy Ads Latency MattersResults and ImpactFrom Short-Term Fix to Strategic AssetFuture PlansAcknowledgments8.3K Impressions1 Comment