Systems & eBPF·November 16, 2026·6 min read

memstall-bpf — eBPF Profiler

Diagnosing silent noisy-neighbor memory bus stalls in Linux & Kubernetes.

memstall-bpf — eBPF Profiler
Probe
eBPF CO-RE
Control Plane
Go Ringbuf
Focus
L3 & PCIe Stalls
Target
K8s SIG Node / DRA

Pipeline & core implementation

Architecture Pipeline
PMU / TracepointeBPF CO-RERingbufGo Profiler
What broke first: Per-event userspace perf copies choked high-frequency workloads; switching to eBPF CO-RE ring buffers with in-kernel histograms cut profiler overhead under 1%.
memstall.bpf.c · C
SEC("tp_btf/sched_switch")
int BPF_PROG(handle_switch, bool preempt, struct task_struct *prev) {
  u64 ns = bpf_ktime_get_ns();
  bpf_map_update_elem(&stall_ts, &prev->pid, &ns, BPF_ANY);
  return 0;
}

Catching silent noisy-neighbor slowdowns

In multi-tenant HPC and Kubernetes nodes, standard CPU and GPU utilization panels (top, nvidia-smi) report plenty of headroom even while co-located streaming loggers hammer DRAM channels and L3 cache. Those memory stalls happen in 10–250 µs bursts that millisecond sampling misses completely.

In-kernel aggregation with Go CLI

memstall-bpf hooks kprobe/handle_mm_fault, kprobe/dma_map_page_attrs, and tp_btf/sched_switch in C using CO-RE BTF, pushing only threshold-breaching microsecond events over a zero-copy BPF ring buffer to a Go daemon. A portable --demo flag simulates noisy-neighbor contention on macOS or non-root shells too.

What remains: multi-node Kubernetes DaemonSet runs

Both the eBPF C instrumentation and Go live TUI / JSON exporter compile cleanly today. Next up is deploying it as a privileged DaemonSet across a multi-node Linux cluster to expose Prometheus /metrics histograms and correlate DRA pod placements with PCIe/DRAM contention spikes.

Measured benchmarks

Ringbuf aggregation< 1 µsIn-kernel mapCO-RE portable BTF
CPU overhead< 1%Multi-tenantUnder saturation test

Project status & checklist

○ Needs work
Done
  • eBPF CO-RE C probes for page-fault, DMA-map & scheduler stalls
  • Go ring-buffer collector, severity spectrum TUI & --export-json CLI
  • Noisy-neighbor C benchmark suite & macOS-compatible --demo simulation mode
Needs to be done
  • Expose Prometheus /metrics HTTP endpoint in the Go daemon
  • Test privileged DaemonSet manifests on multi-node Linux Kubernetes cluster
  • Correlate stall events directly to Kubernetes Pod UID / cgroup v2 paths