[bug] get_cpus is not supporting cgroup2
See original GitHub issueThe current detection of https://github.com/conan-io/conan/blob/1.46.2/conans/client/tools/oss.py#L36-L39 seems no longer applicable in case of cgroup2 as the /sys/fs/cgroup/cpu/cpu.cfs_quota_us
and /sys/fs/cgroup/cpu/cpu.cfs_period_us
are replaced by /sys/fs/cgroup/cpu.max
(in case of docker executed with --cpus
).
There could be checked if cgroup2 is active for example by checking for existence of /sys/fs/cgroup/cgroup.controllers
file and based on that the values for quota
and period
could be taken from cpu.max
file.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
1796543 – virsh cpu-stats does not work with cgroup v2.
does not work with cgroup v2. The command fails with the error 'operation 'getCpuacctPercpuUsage' not supported'. On further analysis I see ...
Read more >ubuntu 22.04 net_cls cgroup mounted over cgroup2 prevents ...
It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in...
Read more >Control Group v2 - The Linux Kernel documentation
cgroup v2 supports thread granularity for a subset of controllers to support use cases requiring hierarchical resource distribution across the threads of a ......
Read more >#934372 - snapd WARNING: cgroup v2 is not fully supported ...
Report forwarded to debian-bugs-dist@lists.debian.org, ryutaroh.matsumoto@nagoya-u.jp, Michael Hudson-Doyle <mwhudson@debian.org> : Bug#934372 ; ...
Read more >[Optional] cgroup v2 - Rootless Containers
Enabling cgroup v2 for containers requires kernel 4.15 or later. Kernel 5.2 or later is recommended. And yet, delegating cgroup v2 controllers to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@MariaMozgunova the
$MAX
incpu.max
is basically the same as quota before, so you can use that to calculate in this case the same.Hi @MariaMozgunova
Yes, there are many tests that require to have some tools installed, like different build systems. You can check the
conftest.py
file, it contains a json declarative syntax to enable/disable/configure required tools. You can write your ownconfuser_test.py
overriding and disabling some tools.If you are going to touch such a very specific tool, I’d recommend looking in the
unittest
andintegration
test folders, the one that are covering the existing functionality and just run them (the folder or the file withpytest <path/to/folder>
. It is going to be much faster and convenient. Don’t worry, our CI run all tests for PRs.