d5e136b82b
Cgroup-v2 uses `cpu.weight` property instead of cpu shares: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#cpu-interface-files . And it uses a different range (i.e. `[1, 10000]`) from cpu.shares (i.e. `[2, 262144]`) to make things more interesting. Luckily, the libcontainer provides a helper function to perform the conversion [`ConvertCPUSharesToCgroupV2Value`](https://pkg.go.dev/github.com/opencontainers/runc@v1.0.2/libcontainer/cgroups#ConvertCPUSharesToCgroupV2Value). I have confirmed that docker/libcontainer performs the conversion as well in https://github.com/opencontainers/runc/blob/v1.0.2/libcontainer/specconv/spec_linux.go#L536-L541 , and that CpuShares is ignored by libcontainer in https://github.com/opencontainers/runc/blob/v1.0.2/libcontainer/cgroups/fs2/cpu.go#L24-L29 . |
||
---|---|---|
.. | ||
proto | ||
test-resources/busybox | ||
client.go | ||
exec_utils.go | ||
executor.go | ||
executor_basic.go | ||
executor_linux.go | ||
executor_linux_test.go | ||
executor_plugin.go | ||
executor_test.go | ||
executor_universal_linux.go | ||
executor_unix.go | ||
executor_windows.go | ||
legacy_executor_wrapper.go | ||
libcontainer_nsenter_linux.go | ||
pid_collector.go | ||
pid_collector_test.go | ||
plugins.go | ||
pty_unix.go | ||
pty_windows.go | ||
resource_container_default.go | ||
resource_container_linux.go | ||
server.go | ||
utils.go | ||
utils_test.go | ||
utils_unix.go | ||
utils_windows.go | ||
z_executor_cmd.go |