Navigation Menu

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 reading cpu.max from cgroups v2 #125

Merged
merged 1 commit into from Sep 28, 2022

Conversation

OrionNebula
Copy link
Contributor

Fixes #124. Each line of /proc/self/cgroup is assigned a version based on the value of the second field (it's always empty for cgroup2). If cgroups v1 and v2 are enabled at the same time, v1 is preferred (not sure if that's actually possible, but the rust standard library accounts for it). Chooses between cpu.max and cpu.cfs_period_us/cpu.cfs_quota_us based on the detected version.

@OrionNebula
Copy link
Contributor Author

Hmm... I was trying to be careful not to break MSRV, but I think I accidentally had a Cargo.lock from a newer version hanging around which made me think it was higher than it really was. Will fix :)

@seanmonstar
Copy link
Owner

Awesome, thanks :D

@seanmonstar seanmonstar merged commit 4f0f2a4 into seanmonstar:master Sep 28, 2022
kodiakhq bot pushed a commit to pdylanross/fatigue that referenced this pull request Jun 30, 2023
Bumps num_cpus from 1.13.1 to 1.16.0.

Release notes
Sourced from num_cpus's releases.

v1.16.0
Features

add support for AIX operating system

Fixes

update hermit-abi to 0.3.0

New Contributors

@​mkroening made their first contribution in seanmonstar/num_cpus#128
@​ecnelises made their first contribution in seanmonstar/num_cpus#123

v1.15.0
Fixes

update hermit-abi

New Contributors

@​striezel made their first contribution in seanmonstar/num_cpus#126
@​buffet made their first contribution in seanmonstar/num_cpus#127

v1.14.0
Features

Support cgroups v2 by @​OrionNebula in seanmonstar/num_cpus#125
Do not attempt to open files in Miri by @​RalfJung in seanmonstar/num_cpus#121

New Contributors

@​RalfJung made their first contribution in seanmonstar/num_cpus#121
@​OrionNebula made their first contribution in seanmonstar/num_cpus#125




Changelog
Sourced from num_cpus's changelog.

v1.16.0
Features

add support for AIX operating system

Fixes

update hermit-abi to 0.3.0

v1.15.0
Fixes

update hermit-abi

v1.14.0
Features

add support for cgroups v2
Skip reading files in Miri




Commits

7c03fc9 v1.16.0
cd76834 add funding file
f3e7081 Support AIX operating system (#123)
edf035c Update CI badges (#132)
3b6e5f0 Bump hermit-abi to 0.3.0 and don't restrict hermit-abi architectures (#128)
5bea3c7 v1.15.0
ccb5a67 chore: update hermit-abi to 0.2.6 (#127)
e437b9d ci: update actions/checkout in GitHub Actions workflows to v3 (#126)
90373f3 v1.14.0
4f0f2a4 Support reading cpu.max from cgroups v2 (#125)
Additional commits viewable in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
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.

Number of CPUs detected incorrectly on systems using cgroups v2
2 participants