From 3e85bf5b1769ac5f7dcdd13791eda07e86462787 Mon Sep 17 00:00:00 2001 From: Peteris Rudzusiks Date: Mon, 15 May 2023 16:03:33 +0200 Subject: [PATCH] resource-control: fix setting CPU affinities on Linux With this fix the vCPU pinning feature chooses the correct physical cores to pin the vCPU threads on rather than always using core 0. Fixes #6831 Signed-off-by: Peteris Rudzusiks --- src/runtime/pkg/resourcecontrol/utils_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/pkg/resourcecontrol/utils_linux.go b/src/runtime/pkg/resourcecontrol/utils_linux.go index 59ca788f8..0acbc6c6a 100644 --- a/src/runtime/pkg/resourcecontrol/utils_linux.go +++ b/src/runtime/pkg/resourcecontrol/utils_linux.go @@ -156,7 +156,7 @@ func IsCgroupV1() (bool, error) { func SetThreadAffinity(threadID int, cpuSetSlice []int) error { unixCPUSet := unix.CPUSet{} - for cpuId := range cpuSetSlice { + for _, cpuId := range cpuSetSlice { unixCPUSet.Set(cpuId) }