最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

linux - sysfscgroupuser.slicecgroup.subtree_control lists only fraction of enabled controllers - Stack Overflow

programmeradmin4浏览0评论

Lately, I found why rootless podman was unable to run containers with some of the constraints:

$ podman run --tty=true --rm --cpuset-cpus=0-3 ubuntu:latest pwd
Error: runc: runc create failed: unable to start container process: error during container init: error setting cgroup config for procHooks process: openat2 /sys/fs/cgroup/user.slice/user-1002.slice/[email protected]/user.slice/0d2d1dfc03a5ae8fcda08a1cf63b10910033023f84e76ae452079800468ec92a/cpuset.cpus: no such file or directory: OCI runtime attempted to invoke a command that was not found

While the necessary cpuset controller was enabled for "user.slice" group:

$ cat /sys/fs/cgroup/user.slice/cgroup.controllers
cpuset cpu io memory pids

the cpuset is disabled down the tree:

$ ls -l /sys/fs/cgroup/user.slice/cgroup.subtree_control
-rw-r--r-- 1 root root 0 Mar 21 09:38 /sys/fs/cgroup/user.slice/cgroup.subtree_control

$ cat /sys/fs/cgroup/user.slice/cgroup.subtree_control
cpu memory pids

inherently, this leads to rootless container runtime not being unable to set cpuset related configs on container process:

$ cat /sys/fs/cgroup/user.slice/user-1002.slice/cgroup.controllers
cpu memory pids

as it will try changing files and folders in sys/fs/cgroup/user.slice/user-1002.slice/[email protected]

This can be fixed by enabling the necessary controllers for user-1002.slice and further in [email protected] folder:

$ echo "+cpuset" | sudo tee /sys/fs/cgroup/user.slice/cgroup.subtree_control
$ echo "+cpuset" | sudo tee /sys/fs/cgroup/user.slice/user-1002.slice/cgroup.subtree_control

My question is why some of the "root-level" enabled controllers are disabled in user.slice subfolder? Is this a bug in OS initiation?


Notes:

  • /sys/fs/cgroup seems like a conventional default mount point for cgroupv2 file system
  • I am running Ubuntu 24.04.2 (kernel v5.15) as WSL2 subsystem on Windows 11.
  • kernel option "cgroup_no_v1=all" is set to disable cgroupv1 controllers.
发布评论

评论列表(0)

  1. 暂无评论