[Bug] Duplicated attach_pid and create_dir_all on cgroup v2 #2856
Labels
Priority: Low
Indicates that an issue or pull request should be resolved behind issues or pull requests labelled `
Type: Performance
Describe the bug
The current implementation contains duplicated
attach_pid
andcreate_dir_all
. Since cgroup v2 uses a unified hierarchy, there is no need to do multiplecreate_dir_all
andattach_pid
. Only onecreate_dir_all
and oneattach_pid
are sufficient. Such redundant overheads will cause significant latency when multiple Firecrackers boot in parallel.To Reproduce
You may use
strace
to see the redundant operations.Additional context
The relevant codes are in
src/jailer/src/cgroup.rs
andsrc/jailer/src/env.rs
. You may need to distinguish the cgroup V1 and V2 when preparing the cgroup environment.Checks
The text was updated successfully, but these errors were encountered: