From 2c7e15091ef1e3a86d1fe2d43ad31e4ad9f1d734 Mon Sep 17 00:00:00 2001 From: Kirtana Ashok Date: Thu, 5 Sep 2024 15:04:06 -0700 Subject: [PATCH] Remove AffinityPreferredNumaNodes and revendor Signed-off-by: Kirtana Ashok --- go.mod | 2 +- internal/hcsoci/create.go | 3 ++- .../opencontainers/runtime-spec/specs-go/config.go | 12 +++++++++--- vendor/modules.txt | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index b65dea35b8..68d9ceccfc 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/internal/hcsoci/create.go b/internal/hcsoci/create.go index c43b0b88b9..a80b45f125 100644 --- a/internal/hcsoci/create.go +++ b/internal/hcsoci/create.go @@ -370,6 +370,7 @@ func setCPUAffinityOnJobObject(ctx context.Context, spec *specs.Spec, computeSys } } + /* if spec.Windows.Resources.CPU.AffinityPreferredNumaNodes != nil { numaNodeInfo, err := coreinfo.GetNumaNodeToProcessorInfo() if err != nil { @@ -393,7 +394,7 @@ func setCPUAffinityOnJobObject(ctx context.Context, spec *specs.Spec, computeSys } } } - +*/ return job.SetInformationJobObject(info) } diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go index a164764f2d..8823e11cda 100644 --- a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +++ b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go @@ -94,6 +94,8 @@ type Process struct { SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` // IOPriority contains the I/O priority settings for the cgroup. IOPriority *LinuxIOPriority `json:"ioPriority,omitempty" platform:"linux"` + // ExecCPUAffinity specifies CPU affinity for exec processes. + ExecCPUAffinity *CPUAffinity `json:"execCPUAffinity,omitempty" platform:"linux"` } // LinuxCapabilities specifies the list of allowed capabilities that are kept for a process. @@ -127,6 +129,12 @@ const ( IOPRIO_CLASS_IDLE IOPriorityClass = "IOPRIO_CLASS_IDLE" ) +// CPUAffinity specifies process' CPU affinity. +type CPUAffinity struct { + Initial string `json:"initial,omitempty"` + Final string `json:"final,omitempty"` +} + // Box specifies dimensions of a rectangle. Used for specifying the size of a console. type Box struct { // Height is the vertical dimension of a box. @@ -629,8 +637,6 @@ type WindowsCPUResources struct { Maximum *uint16 `json:"maximum,omitempty"` // Set of CPUs to affinitize for this container. AffinityCPUs []WindowsCPUGroupAffinity `json:"affinityCPUs,omitempty"` - // Specifies preferred set of numa node numbers to affinitize for this container. - AffinityPreferredNumaNodes []uint32 `json:"affinityPreferredNumaNodes,omitempty"` } // Similar to _GROUP_AFFINITY struct defined in @@ -638,7 +644,7 @@ type WindowsCPUResources struct { type WindowsCPUGroupAffinity struct { // CPU mask relative to this CPU group. CPUMask uint64 `json:"cpuMask,omitempty"` - // Processor group the mask refers to, as returned by GetLogicalProcessorInformationEx. + // CPU group that this CPU belongs to. CPUGroup uint32 `json:"cpuGroup,omitempty"` } diff --git a/vendor/modules.txt b/vendor/modules.txt index 785785c92f..2a16108323 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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