0

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:~> 
5
  • Is this opensuse mounting the cgroup and/or cgroup2 filesystem? If so, has some mount parameter changed? Commented Feb 18 at 23:42
  • @DavidG. I checked, and there's a cgroup2 filesystem mounted at /sys/fs/cgroup. And, I just added the procedure I use to create the cpuset. Commented Feb 19 at 3:16
  • @DavidG. I looked in /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? Commented Feb 19 at 12:15
  • One shouldn't look in /etc/fstab, as that rarely includes the virtual filesystems. Generally, one should look in /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. Commented Feb 19 at 13:28
  • @DavidG. /proc/mounts shows the following lines: cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0, and none /dev/cpuset cgroup rw,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0. Commented Feb 19 at 14:31

2 Answers 2

1

OP also reports the following lines in /proc/mounts :

cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
none /dev/cpuset cgroup rw,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0

The later is the mount at /dev/cpuset. It is set to show only the cpuset entries of cgroup. The noprefix clause is almost certainly the cause of OP's change.

To undo this, try:

# umount /dev/cpuset
# mount -t cgroup -o cpuset,release_agent=/sbin/cpuset_release_agent none /dev/cpuset

I will admit to know knowing what "release_agent=" does.

To undo it permanently... might be tricky, as /dev/ is mounted and managed oddly. But you could try a relevant line in /etc/fstab

none /dev/cpuset cgroup cpuset,release_agent=/sbin/cpuset_release_agent 0 0
0

It turns out that, between openSUSE 15.5 and openSUSE 16, systemd was upgraded. One significant change: systemd now uses cgroup v2 by default. This changes a number of paths, including those used by cpuset (which is emulated by cgroup).

References:

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.