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

cgroups: v2 disable unused controllers #14372

Closed
shoenig opened this issue Aug 29, 2022 · 1 comment
Closed

cgroups: v2 disable unused controllers #14372

shoenig opened this issue Aug 29, 2022 · 1 comment
Milestone

Comments

@shoenig
Copy link
Member

shoenig commented Aug 29, 2022

Given the "inverted" nature of cgroups v1 & v2, one could describe v1 as "opt-in" controllers and v2 as "opt-out" controllers. When we added support for v2 did not consider that processes being added to Nomad's task cgroups would be having all controllers activated - including ones that were never being used before like rdma, misc, etc. These may have unwanted side affects.

Nomad should set cgroup.subtree_controll on Nomad's parent cgroup (e.g. nomad.slice) so that only cpu, memory, and cpuset controllers are activated on the per-task cgroups.

Note: we need to be careful to only activate/de-activate controllers actually present in cgroup.controllers (which will vary per-system) - otherwise the kernel will fail the underlying syscall.

e.g.

err = os.WriteFile(subtree, []byte("+cpu +cpuset +memory -pids -io -hugetlb -rdma -misc"), 0o644)
@shoenig
Copy link
Member Author

shoenig commented Oct 24, 2023

As of #18371 we ensure the correct cgroup controllers are enabled.

@shoenig shoenig closed this as completed Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants