by a lot of context switches inside the container when we ran UnixBench. • ~ 6 % overhead when we use runc ⚫But crun did not decrease the performance. 5 Machine x86-64 OS Ubuntu 20.04: 5.4.0-56-generic runtime runc, crun CPU AMD Ryzen 9 3900X 12-Core Processor Memory 32GB Benchmark unixbench, mbw, iperf Environment
different • runc : /sys/fs/cgroup/cpu/user.slice/{container-id} – It depends on the runc’s settings. • crun : /sys/fs/cgroup/cpu/{container-id} as default 6
depth • The difference of the CPU resource allocation degrades the performance. 2. The overhead of the cgroup hierarchy walking • The number of enqueue_entity() and dequene_entity() impacts the performance. 8
same resource allocation and usage, the performance is degraded. 9 ~ 9 % overhead ~ 16 % overhead No tasks directly under the group No tasks directly under the group No tasks directly under the group
Kernel Community has already found this issue. ⚫Problems • Build up entire hierarchy on wakeup • Tear it back down when task sleeps • Do vruntime accounting at each level at every reschedule • Preemption decisions re-evaluated at every level • load_avg calculated periodically 11 https://www.linuxplumbersconf.org/event/4/contributions/288/
design into the mainline. ⚫Basic design • All tasks in root cfs_rq • Groups not placed on root cfs_rq • Rate limit hierarchy walks as much as possible • Use hierarchical load & weight for task priority • Scale vruntime with hierarchical task weight • Slight variation on vruntime formula 12 https://www.linuxplumbersconf.org/event/7/contributions/762/