Skip to content

Commit

Permalink
Remove AffinityPreferredNumaNodes and revendor
Browse files Browse the repository at this point in the history
Signed-off-by: Kirtana Ashok <[email protected]>
  • Loading branch information
kiashok committed Sep 5, 2024
1 parent f318f38 commit c2121ec
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Microsoft/hcsshim

go 1.21.12
go 1.22.4

require (
github.com/Microsoft/cosesign1go v1.1.0
Expand Down
42 changes: 21 additions & 21 deletions internal/hcsoci/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"strconv"

"github.com/Microsoft/go-winio/pkg/guid"
"github.com/Microsoft/hcsshim/internal/coreinfo"
"github.com/Microsoft/hcsshim/internal/cow"
"github.com/Microsoft/hcsshim/internal/guestpath"
"github.com/Microsoft/hcsshim/internal/hcs"
Expand Down Expand Up @@ -370,30 +369,31 @@ func setCPUAffinityOnJobObject(ctx context.Context, spec *specs.Spec, computeSys
}
}

if spec.Windows.Resources.CPU.AffinityPreferredNumaNodes != nil {
numaNodeInfo, err := coreinfo.GetNumaNodeToProcessorInfo()
if err != nil {
return fmt.Errorf("error getting numa node info: %v", err)
}
// check if cpu affinities are also set and consolidate the masks
if len(info) > 0 {
for _, numaNode := range numaNodeInfo {
doesCpuAffinityExist := false
for ind, _ := range info {
if info[ind].CpuGroup == numaNode.CpuGroup {
doesCpuAffinityExist = true
// overwrite the entire mask of the numa node
info[ind].CpuMask = numaNode.CpuMask
break
/*
if spec.Windows.Resources.CPU.AffinityPreferredNumaNodes != nil {
numaNodeInfo, err := coreinfo.GetNumaNodeToProcessorInfo()
if err != nil {
return fmt.Errorf("error getting numa node info: %v", err)
}
// check if cpu affinities are also set and consolidate the masks
if len(info) > 0 {
for _, numaNode := range numaNodeInfo {
doesCpuAffinityExist := false
for ind, _ := range info {
if info[ind].CpuGroup == numaNode.CpuGroup {
doesCpuAffinityExist = true
// overwrite the entire mask of the numa node
info[ind].CpuMask = numaNode.CpuMask
break
}
}
if !doesCpuAffinityExist {
info = append(info, numaNode)
}
}
if !doesCpuAffinityExist {
info = append(info, numaNode)
}
}
}
}

*/
return job.SetInformationJobObject(info)
}

Expand Down
12 changes: 9 additions & 3 deletions vendor/github.com/opencontainers/runtime-spec/specs-go/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ github.com/opencontainers/image-spec/specs-go/v1
github.com/opencontainers/runc/libcontainer/devices
github.com/opencontainers/runc/libcontainer/user
# github.com/opencontainers/runtime-spec v1.1.0 => ../../runtime-spec/
## explicit; go 1.21.12
## explicit; go 1.22.4
github.com/opencontainers/runtime-spec/specs-go
# github.com/pelletier/go-toml v1.9.5
## explicit; go 1.12
Expand Down

0 comments on commit c2121ec

Please sign in to comment.