Reading memcg stats more efficiently
summary
Periodic memcg reads spend most time formatting text so the team implements BPF kfuncs to iterate cgroups, map a binary data section to user space and fetch only needed fields, cutting kernel CPU time by about 90% kernel time reduction in benchmarks and eliminating expensive string conversion. Earlier per-subsystem rstat separation landed in 6.16 and saved over a million dollars saved by avoiding cross-subsystem flushes. A proposed CPU stat stream_interval uses a root async flush, sequence numbers and wait/notify so readers sleep and wake only when fresh data is ready.
AI-written summary · about
chapters (8)
- 0:00Introduction to memcg stats
- 1:06Historical delays in stat reading
- 2:52Separation of cgroup stats
- 3:35String formatting overhead
- 5:39BPF-based stat fetching
- 8:13Reading stats in parallel
- 10:18Proposed paradigm shift
- 15:11Q&A on stat efficiency
related talks
22mEnhancing RISC-V Performance Analysis Infrastructure
27mDebugging Linux Issues with eBPF
41mLinux Systems Performance
51mLinux Systems Performance - Architecture
38mEfficient Ceph Performance Troubleshooting in Production Using eBPF
21mPerformance Wins with BPF: Getting Started
15mPerformance Management Q&A
32mIs Your Kernel Being Honest? Understanding & measuring low level bottlenecks
