Skip to content
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

[do not review] chrore: parse cgroup v2 #3857

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[do not review] chrore: parse cgroup v2 #3857

wants to merge 1 commit into from

Conversation

kostasrim
Copy link
Contributor

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, in cgroup version 2, all of the controllers reside in the same folder /sys/fs/cgroup/. This PR add support to parse version 2 cgroups under the unified directory model.

  • add support for parsing cgroup version 2

Probably resolves #3812

@kostasrim kostasrim self-assigned this Oct 3, 2024
};

// For v1
constexpr auto base_mem_v1 = "/sys/fs/cgroup/memory"sv;
Copy link
Contributor Author

@kostasrim kostasrim Oct 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed in deducing any cgroup limits when the instance starts
1 participant