You've already forked runc
mirror of
https://github.com/opencontainers/runc.git
synced 2026-10-23 19:49:01 +03:00
libct: reuse configs.MaxCPU
Suggested-by: Li Fubang <lifubang@acmcoder.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -202,8 +202,7 @@ func tryResetCPUAffinity(pid int) {
|
||||
// /sys/devices/system/cpu/possible and kernel_max.
|
||||
// Instead, we use a huge buffer similarly to go 1.25 runtime in
|
||||
// getCPUCount().
|
||||
const maxCPUs = 64 * 1024
|
||||
buf := unix.NewCPUSet(maxCPUs)
|
||||
buf := unix.NewCPUSet(configs.MaxCPU)
|
||||
buf.Fill()
|
||||
if err := linux.SchedSetaffinity(pid, buf); err != nil {
|
||||
logrus.WithError(err).Warnf("resetting the CPU affinity of pid %d failed -- the container process may inherit runc's CPU affinity", pid)
|
||||
|
||||
Reference in New Issue
Block a user