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

Support cgroups v2 and its unified hierarchy #21

Closed
ajwerner opened this issue Jan 2, 2020 · 2 comments · Fixed by #44
Closed

Support cgroups v2 and its unified hierarchy #21

ajwerner opened this issue Jan 2, 2020 · 2 comments · Fixed by #44
Assignees

Comments

@ajwerner
Copy link

ajwerner commented Jan 2, 2020

It seems from the code that this only consults the v1 cgroup and its specific subsystem. It seems that more and more code will move to using v2 cgroups and the unified hierarchy. I'm creating this issue to track support for v2 cgroups.

@jcorbin
Copy link
Contributor

jcorbin commented Jan 7, 2020

So at a basic / short term level, yes this library can and should support cgroups v2.

Longer term however, we'd like to get mainline support for correctly setting GOMAXPROCS within a container golang/go#33803 and deprecate this library.

@jcorbin jcorbin self-assigned this Jan 7, 2020
abhinav added a commit that referenced this issue Apr 5, 2022
Add support for setting GOMAXPROCS based on CPU allotment in a system
with cgroups v2.

This works by adding a new internal CGroups2 type that is able to
provide the CPU quota if the system is using cgroups v2.
In the main GOMAXPROCS assignment logic, we use this variant if we're
able to, falling back to the v1 version if not.

Resolves #21 

Co-authored-by: Abhinav Gupta <abg@uber.com>
Co-authored-by: Matt Way <mway@uber.com>
@abhinav abhinav reopened this Apr 6, 2022
@abhinav
Copy link
Contributor

abhinav commented Apr 6, 2022

Was going to reopen because the v2 support was broken, but looks like we already have #49.

@abhinav abhinav closed this as completed Apr 6, 2022
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 a pull request may close this issue.

3 participants