-
Notifications
You must be signed in to change notification settings - Fork 998
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
chrore: parse cgroup v2 #3857
chrore: parse cgroup v2 #3857
Conversation
}; | ||
|
||
// For v1 | ||
constexpr auto base_mem_v1 = "/sys/fs/cgroup/memory"sv; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. There are no memory.max
in root cgroup
. That means that always, even before this PR the read_mem(StrCat(base_mem, "/memory.limit_in_bytes"), &mdata->mem_total);
would never read anything
See my comments in the GH issue.
How can I test the changes? How to reproduce running under cgroups v2 on my dev machine? |
Does your machine use Also, note that I suspect that To fully answer, step through your GDB if you are using |
that's what I get when running from master branch with vlog=1:
|
Yep this makes sense, as I said the paths
Also keep in mind that the problem described in the issue was not
Which should be now fixed since |
Currently, parsing
cgroups
only works for version 1. In this version, each controller has its own subfolder so for example when we want to fetch memory controller info we search for files in/sys/fs/cgroup/memory
. However, incgroup version 2
, all of the controllers reside in the same folder/sys/fs/cgroup/
. This PR add support to parseversion 2 cgroups
under the unified directory model. Furthermore, we also not parsesys/fs/cgroup/user.slice/
sys/fs/cgroup/user.slice/
Probably resolves #3812