-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Duplicated attach_pid and create_dir_all on cgroup v2 #2856
Comments
Hi, I hadn't seen this issue before. Thanks for the suggestion. It is very interesting, do you have a way of reproducing this so we can analyze the performance difference? |
Hi, a micro-benchmark that creates Firecrackers (jailers) with multiple threads can reproduce this issue, although I am not sure if this is a case in production where cloud providers bypass concurrency contentions with tricks like reusing Firecrackers. If this is a valuable use case, I can draft the micro-benchmark to reproduce this. |
I think having a simple example how to set up the cgroups and how to run one firecracker would be enough to reproduce it. Thanks! |
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: