Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgroups: cpuset: fix byte order while parsing cpuset range to bits
Runc parses cpuset range to bits in the case of cgroup v2 + systemd as cgroup driver. The byte order representation differs from systemd expectation, which will set different cpuset range in systemd transient unit if the length of parsed byte array exceeds one. # cat config.json ... "resources": { ... "cpu": { "cpus": "10-23" } }, ... # runc --systemd-cgroup run test # cat /run/systemd/transient/runc-test.scope.d/50-AllowedCPUs.conf # This is a drop-in unit file extension, created via "systemctl set-property" # or an equivalent operation. Do not edit. [Scope] AllowedCPUs=0-7 10-15 The cpuset.cpus in cgroup will also be set to wrong value after reloading systemd manager configuration. # systemctl daemon-reload # cat /sys/fs/cgroup/system.slice/runc-test.scope/cpuset.cpus 0-7,10-15 Signed-off-by: seyeongkim <seyeong.kim@canonical.com> Signed-off-by: Chengen, Du <chengen.du@canonical.com>
- Loading branch information