I'm working on some old scripts that deal with cpusets, porting to openSUSE. The scripts worked fine with openSUSE 15.5, but now with 15.6 they fail because the /dev/cpuset
files they expect aren't there. In fact, the files are all there, but they've lost the prefix cpuset.
in their names.
For instance, for a cpuset named sys
, the scripts expect to manipulate /dev/cpuset/sys/cpuset.cpus
, but the actual file seems to be named /dev/cpuset/sys/cpus
. This pattern continues for all thirteen files that on openSUSE 15.5 (and older systems) had names starting with cpuset.
; the same files are there, but without the cpuset.
prefix.
Looking at docs.kernel.org's reference page, the cpuset.*
naming is what is documented. Any idea where the files missing the cpuset.
prefix came from?
More info: here's the full /dev/cpuset/sys
directory (where sys
is a cpuset name) on a openSUSE Leap 15.5 machine:
devuser@product:/dev/cpuset/sys> ls -al
total 0
drwxr-xr-x 2 root root 0 Feb 18 14:07 .
dr-xr-xr-x 3 root root 0 Feb 18 14:03 ..
-rw-r--r-- 1 root root 0 Feb 18 14:07 cgroup.clone_children
-rw-r--r-- 1 root root 0 Feb 18 14:07 cgroup.procs
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.cpu_exclusive
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.cpus
-r--r--r-- 1 root root 0 Feb 18 14:07 cpuset.effective_cpus
-r--r--r-- 1 root root 0 Feb 18 14:07 cpuset.effective_mems
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.mem_exclusive
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.mem_hardwall
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.memory_migrate
-r--r--r-- 1 root root 0 Feb 18 14:07 cpuset.memory_pressure
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.memory_spread_page
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.memory_spread_slab
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.mems
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.sched_load_balance
-rw-r--r-- 1 root root 0 Feb 18 14:07 cpuset.sched_relax_domain_level
-rw-r--r-- 1 root root 0 Feb 18 14:07 notify_on_release
-rw-r--r-- 1 root root 0 Feb 18 14:07 tasks
devuser@product:/dev/cpuset/sys>
And here's the same directory on an openSUSE 15.6 machine:
devuser@product:/dev/cpuset/sys> ls -al
total 0
drwxr-xr-x 2 root root 0 Feb 18 11:25 .
dr-xr-xr-x 5 root root 0 Feb 18 11:25 ..
-rw-r--r-- 1 root root 0 Feb 18 11:29 cgroup.clone_children
-rw-r--r-- 1 root root 0 Feb 18 11:29 cgroup.procs
-rw-r--r-- 1 root root 0 Feb 18 11:29 cpu_exclusive
-rw-r--r-- 1 root root 0 Feb 18 11:29 cpus
-r--r--r-- 1 root root 0 Feb 18 11:29 effective_cpus
-r--r--r-- 1 root root 0 Feb 18 11:29 effective_mems
-rw-r--r-- 1 root root 0 Feb 18 11:29 mem_exclusive
-rw-r--r-- 1 root root 0 Feb 18 11:29 mem_hardwall
-rw-r--r-- 1 root root 0 Feb 18 11:29 memory_migrate
-r--r--r-- 1 root root 0 Feb 18 11:29 memory_pressure
-rw-r--r-- 1 root root 0 Feb 18 11:29 memory_spread_page
-rw-r--r-- 1 root root 0 Feb 18 11:29 memory_spread_slab
-rw-r--r-- 1 root root 0 Feb 18 11:29 mems
-rw-r--r-- 1 root root 0 Feb 18 11:29 notify_on_release
-rw-r--r-- 1 root root 0 Feb 18 11:29 sched_load_balance
-rw-r--r-- 1 root root 0 Feb 18 11:29 sched_relax_domain_level
-rw-r--r-- 1 root root 0 Feb 18 12:41 tasks
devuser@product:/dev/cpuset/sys>
So, exactly the same set of files, except that where Leap 15.5 has a cpuset.
prefix on thirteen of file files, Leap 15.6 has the same files but with cpuset.
removed.
Edit: here's how I made the cpuset directory on the Leap 15.6 system. On a freshly-rebooted system:
devuser@product:~> ls /dev/cpuset
ls: cannot access '/dev/cpuset': No such file or directory
devuser@product:~> sudo mkdir /dev/cpuset
[sudo] password for root:
devuser@product:~> sudo mount -t cpuset none /dev/cpuset
devuser@product:~> sudo mkdir /dev/cpuset/sys
devuser@product:~> ls /dev/cpuset/sys
cgroup.clone_children mem_exclusive mems
cgroup.procs mem_hardwall notify_on_release
cpu_exclusive memory_migrate sched_load_balance
cpus memory_pressure sched_relax_domain_level
effective_cpus memory_spread_page tasks
effective_mems memory_spread_slab
devuser@product:~>
/etc/fstab
, and there's no entry for the/sys/fs/cgroup
, so I don't know how it got mounted, nor what options might have been used. Where should I look?/proc/mounts
to see what is mounted. A convenient shortcut:df <directory>
will tell you where the mountpoint is, and might give you some hints about what the filesystem is./proc/mounts
shows the following lines:cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
, andnone /dev/cpuset cgroup rw,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0
.