Suppose on Ubuntu 22.04, RHEL9 or Centos 9 Stream I have cgroup v2 turned off using systemd.unified_cgroup_hierarchy=0 boot option. So I have only cgroup v1 and I want to mount cpu subsystem. The problem is that I can do it for cpu,cpuacct, blkio, etc. subsystems. But it does not work for cpu subsystem.

I get Device or resource busy error when mounting cpu subsystem. What is the problem and what is the cpu,cpuacct? I have searched everywhere but cannot find it.

# mount -t cgroup -o cpu none tmp0
mount: /root/tmp0: none already mounted on <... does not matter really ...>.

The output of cat /proc/cgroups is

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  4       1       1
cpu     3       2       1
cpuacct 3       2       1
blkio   10      2       1

Here is the contents of /sys/fs/cgroup:

enter image description here

Here is the mounted cgroup* points:

enter image description here

1 Answer 1


Here is the answer (https://man7.org/linux/man-pages/man7/cgroups.7.html):

It is not possible to mount the same controller against multiple cgroup hierarchies. For example, it is not possible to mount both the cpu and cpuacct controllers against one hierarchy, and to mount the cpu controller alone against another hierarchy. It is possible to create multiple mount with exactly the same set of comounted controllers. However, in this case all that results is multiple mount points providing a view of the same hierarchy.\

On the systems that I've tested there was /sys/fs/cgroup/cpu,cpuacct. And AFAIU even unmounting it may be not enough if there are already some sub-folders (sub-hierarchies) inside this /sys/fs/cgroup/cpu,cpuacct, used by some processes.

In my case though it was enough to unmount /sys/fs/cgroup/cpu,cpuacct and I was able to mount with -o cpu, rather than with -o cpu,cpuacct.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .