我正在研究一些处理 cpuset 的旧脚本,并将其移植到 openSUSE。这些脚本在 openSUSE 15.5 上运行良好,但现在在 15.6 中它们失败了,因为它们期望的文件不存在。事实上,文件都在那里,但它们的名称中/dev/cpuset
缺少前缀。cpuset.
例如,对于名为 的 cpuset sys
,脚本期望操作/dev/cpuset/sys/cpuset.cpus
,但实际文件似乎名为/dev/cpuset/sys/cpus
。这种模式适用于 openSUSE 15.5(及更早的系统)上所有 13 个以 开头的文件cpuset.
;相同的文件在那里,但没有cpuset.
前缀。
查看docs.kernel.org 的参考页面,cpuset.*
命名就是文档中记录的。知道缺少前缀的文件cpuset.
来自哪里吗?
更多信息:这是 openSUSE Leap 15.5 机器上的完整/dev/cpuset/sys
目录(其中sys
是 cpuset 名称):
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>
以下是 openSUSE 15.6 机器上的同一目录:
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>
因此,文件集完全相同,只是 Leap 15.5cpuset.
在 13 个文件上有前缀,而 Leap 15.6 有相同的文件但被cpuset.
删除了。
编辑:以下是我在 Leap 15.6 系统上创建 cpuset 目录的方法。在刚刚重启的系统上:
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:~>