From 5e691aea6d6ebcf37bdceb8c346b552b7c48095e Mon Sep 17 00:00:00 2001 From: "justin.cheng" Date: Mon, 19 Jan 2026 17:03:07 +0800 Subject: [PATCH 1/2] feat(cpu): support align by socket, distribute evenly across numa and full pcpus pairing --- pkg/consts/qos.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/consts/qos.go b/pkg/consts/qos.go index 16a4b7ae..9516d2e9 100644 --- a/pkg/consts/qos.go +++ b/pkg/consts/qos.go @@ -138,6 +138,26 @@ const ( // For cgroup v1, the cpu burst value is calculated using cpu.cfs_quota_us * (cpu_burst_percent / 100) // For cgroup v2, the cpu burst value is calculated using cpu.max * (cpu_burst_percent / 100) PodAnnotationCPUEnhancementCPUBurstPercent = "cpu_burst_percent" + + // PodAnnotationCPUEnhancementAlignBySocket is a strong constraint that determines if the cpu cores allocated + // should be within the fewest number of sockets possible. For example, if a socket has 16 cores, + // and a pod requests 15 cores, it must be allocated within one socket. + // If a socket has 16 cores, and a pod requests 17 cores, it must be allocated within two sockets. + // If set to true, the above conditions must be met. + PodAnnotationCPUEnhancementAlignBySocket = "align_by_socket" + PodAnnotationCPUEnhancementAlignBySocketEnable = "true" + + // PodAnnotationCPUEnhancementDistributeEvenlyAcrossNuma determines if the cpu cores allocated should be distributed + // evenly across NUMA nodes. This affects the preferred label in the topology hints. + PodAnnotationCPUEnhancementDistributeEvenlyAcrossNuma = "distribute_evenly_across_numa" + PodAnnotationCPUEnhancementDistributeEvenlyAcrossNumaEnable = "true" + + // PodAnnotationCPUEnhancementFullPCPUsPairing is a strong constraint that restricts the core allocation to + // full physical cores only. This means the cpu cores allocated must come from different physical cores, + // and only one of the threads in each core is allocated, while the remaining threads are idle. + // If set to true, the above conditions must be met. + PodAnnotationCPUEnhancementFullPCPUsPairing = "full_pcpus_pairing" + PodAnnotationCPUEnhancementFullPCPUsPairingEnable = "true" ) // const variables for pod annotations about qos level enhancement in network From d80dd24ad1c6ba0fbce3f48c64e98917366ec17d Mon Sep 17 00:00:00 2001 From: "justin.cheng" Date: Mon, 26 Jan 2026 17:09:58 +0800 Subject: [PATCH 2/2] feat(cpu): support numa number and numa ids --- pkg/consts/qos.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/consts/qos.go b/pkg/consts/qos.go index 9516d2e9..58cca343 100644 --- a/pkg/consts/qos.go +++ b/pkg/consts/qos.go @@ -148,7 +148,7 @@ const ( PodAnnotationCPUEnhancementAlignBySocketEnable = "true" // PodAnnotationCPUEnhancementDistributeEvenlyAcrossNuma determines if the cpu cores allocated should be distributed - // evenly across NUMA nodes. This affects the preferred label in the topology hints. + // evenly across NUMA nodes. PodAnnotationCPUEnhancementDistributeEvenlyAcrossNuma = "distribute_evenly_across_numa" PodAnnotationCPUEnhancementDistributeEvenlyAcrossNumaEnable = "true" @@ -158,6 +158,13 @@ const ( // If set to true, the above conditions must be met. PodAnnotationCPUEnhancementFullPCPUsPairing = "full_pcpus_pairing" PodAnnotationCPUEnhancementFullPCPUsPairingEnable = "true" + + // PodAnnotationCPUEnhancementNumaNumber is a strong constraint that restricts the hints to be of a certain NUMA count. + PodAnnotationCPUEnhancementNumaNumber = "katalyst.kubewharf.io/numa_number" + + // PodAnnotationCPUEnhancementNumaIDs is a strong constraint that restricts the hints to be within specific NUMA IDs. + // PodAnnotationCPUEnhancementNumaIDs is of a priority than PodAnnotationCPUEnhancementNumaNumber. + PodAnnotationCPUEnhancementNumaIDs = "katalyst.kubewharf.io/numa_ids" ) // const variables for pod annotations about qos level enhancement in network