Unable to read from '/dev/cpuset/machine.slice/cpuset.cpus'
Software environment
- Operating system: Red Hat Enterprise Linux 9.2
- Architecture: x86_64
- kernel version: 6.6.0-rc3
- libvirt version: 9.0.0
- Hypervisor and version: QEMU 7.2.0
Description of problem
Unable to create a virtual machine when the cpuset subsystem is mounted with the noprefix option. libvirt can not access cpuset.cpus, cpuset.mems, and cpuset.memory_migrate (see src/util/vircgroupv1.c).
Steps to reproduce
- Mount the cpuset subsystem with the noprefix option:
mount -o cpuset,noprefix,release_agent=/sbin/cpuset_release_agent -t cgroup cgroup /dev/cpuset
- Create a new virtual machine.
Additional information
The noprefix option was introduced for backward compatibility (see kernel/cgroup/cgroup-v1.c). Specifying cpuset as the filesystem type will cause the same issue because the CGRP_ROOT_NOPREFIX bit will be set.
# mount -o cpuset,noprefix,release_agent=/sbin/cpuset_release_agent -t cgroup cgroup /dev/cpuset
or
# mount -t cpuset cpuset /dev/cpuset
# grep 'cpuset' /proc/mounts
cgroup /dev/cpuset cgroup rw,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0
# ls -w 1 /dev/cpuset
cgroup.clone_children
cgroup.procs
cgroup.sane_behavior
cpu_exclusive
cpus
effective_cpus
effective_mems
mem_exclusive
mem_hardwall
memory_migrate
memory_pressure
memory_pressure_enabled
memory_spread_page
memory_spread_slab
mems
notify_on_release
release_agent
sched_load_balance
sched_relax_domain_level
tasks
# virt-install ...
...
ERROR Unable to read from '/dev/cpuset/machine.slice/cpuset.cpus': No such file or directory