mirror of
https://github.com/opencontainers/runc.git
synced 2026-08-09 09:32:49 +00:00
ToCPUSet was limited to unix.CPUSet (a fixed-size mask capped at 1024 CPUs). Switch CPUAffinity, LinuxMemoryPolicy.Nodes, ToCPUSet, and SetMempolicy to unix.CPUSetDynamic, which can represent arbitrary CPU and NUMA node IDs. ToCPUSet now parses the input in a first pass to find the maximum value, then allocates a mask large enough to hold it (out-of-range Set calls on a dynamic mask are silently ignored). An arbitrary sanity cap is kept to avoid huge allocations on bogus input. This is backward compatible with reading older state.json: both the old *unix.CPUSet (a fixed array) and the new CPUSetDynamic (a slice) marshal to and from the same JSON array-of-numbers representation. Update TestToCPUSet accordingly, adding coverage for values beyond the old non-dynamic limit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>