mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-09 04:39:17 +00:00
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:
committed by
Fabiano Fidêncio
parent
4ec5db0fb3
commit
d37c6e370d
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user