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 <rye@stripe.com>
This commit is contained in:
Peteris Rudzusiks 2023-05-15 16:03:33 +02:00
parent 9e83795fca
commit 3e85bf5b17

View File

@ -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)
}