arXiv:2609.02052cs.OSSep 2026

Manuscript Offprint

arXiv:2609.02052

SchedBlame: Who Ran While You Waited? Culprit-Attributed CPU Contention for Containers on Stock Kernels

Hao Li, Tonghao Zhang, Honglei Wang

Abstract

Containers that share a machine compete for CPU. When one slows down, the operator needs to know which co-tenant is responsible, and no deployed signal can say. Pressure stall information, per-cgroup wait counters, and run-queue latency histograms are all victim-side: they report that a container waited, never who it waited for. Recovering the culprit today means patching the kernel, which does not travel across a fleet; or enabling full scheduler tracing, which cannot stay on; or inferring blame statistically, which misattributes exactly when several victims are hurting at once.

SchedBlame is an eBPF tracer that attributes CPU contention to the cgroups that caused it, on stock kernels, continuously. It inverts the usual accounting. Instead of measuring how long a victim waited, it measures the CPU time every other cgroup consumed while that victim was runnable but not running on the same CPU. The mechanism is a per-CPU bitmap of which measured cgroups are waiting, maintained from the kernel's own runnable counts at four scheduler hooks. Every completed run slice carries that bitmap, so a single 16-byte record charges CPU time to a full row of a competitor × victim blame matrix. The kernel stores no per-pair state.

Three properties follow. Slices are self-describing, so userspace holds no waiting state and a lost record costs measurements rather than correctness. The measured set is reconfigured by publishing an epoch, which invalidates every classification cache and every per-CPU bitmap in constant time while the hooks keep running. And sampling discards slices without touching waiting state, so the sampling rate trades variance against cost and nothing else; userspace rescales retained slices by the inverse keep probability, which yields an unbiased estimator.

SchedBlame decomposes each container's per-second CPU demand into runtime, internal contention, external contention, and bandwidth throttling, flags anomalies against a rolling 99th-percentile baseline, and names the competitors responsible. It runs on unmodified 4.18 and 5.10 kernels. In production on a 96-core host tracking 84 containers, it costs about 1% of Redis throughput and 6% of one core.

Keywords

CPU contention, performance interference, noisy neighbors, eBPF, CFS, cgroups, containers, attribution, observability

References (10)