Skip to content

Commit 4858a44

Browse files
authored
Merge pull request #631 from csfldf/dev/fix_rampup_cpu
fix(qrm): make ramp up cpus not overlapping with cpus in NUMAs containing NUMA_binding pods
2 parents aec50da + 9e6f2fe commit 4858a44

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_advisor_handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,12 @@ func (p *DynamicPolicy) applyBlocks(blockCPUSet advisorapi.BlockCPUSet, resp *ad
539539
return fmt.Errorf("GetSharedBindingNUMAs failed with error: %v", err)
540540
}
541541
sharedBindingNUMACPUs := p.machineInfo.CPUDetails.CPUsInNUMANodes(sharedBindingNUMAs.UnsortedList()...)
542-
// rampUpCPUs include reclaim pool
542+
// rampUpCPUs include reclaim pool in NUMAs without NUMA_binding cpus
543543
rampUpCPUs := p.machineInfo.CPUDetails.CPUs().
544544
Difference(p.reservedCPUs).
545545
Difference(dedicatedCPUSet).
546-
Difference(sharedBindingNUMACPUs).
547-
Union(newEntries[state.PoolNameReclaim][state.FakedContainerName].AllocationResult)
546+
Difference(sharedBindingNUMACPUs)
547+
548548
rampUpCPUsTopologyAwareAssignments, err := machine.GetNumaAwareAssignments(p.machineInfo.CPUTopology, rampUpCPUs)
549549
if err != nil {
550550
return fmt.Errorf("unable to calculate topologyAwareAssignments for rampUpCPUs, result cpuset: %s, error: %v",

pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_allocation_handlers.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ func (p *DynamicPolicy) sharedCoresWithoutNUMABindingAllocationHandler(_ context
6868

6969
machineState := p.state.GetMachineState()
7070
pooledCPUs := machineState.GetFilteredAvailableCPUSet(p.reservedCPUs,
71-
func(ai *state.AllocationInfo) bool {
72-
return state.CheckDedicated(ai) || state.CheckNUMABinding(ai)
73-
}, state.CheckDedicatedNUMABinding)
71+
state.CheckDedicated, state.CheckNUMABinding)
7472

7573
if pooledCPUs.IsEmpty() {
7674
general.Errorf("pod: %s/%s, container: %s get empty pooledCPUs", req.PodNamespace, req.PodName, req.ContainerName)
@@ -880,12 +878,11 @@ func (p *DynamicPolicy) applyPoolsAndIsolatedInfo(poolsCPUSet map[string]machine
880878
}
881879

882880
sharedBindingNUMACPUs := p.machineInfo.CPUDetails.CPUsInNUMANodes(sharedBindingNUMAs.UnsortedList()...)
883-
// rampUpCPUs include reclaim pool
881+
// rampUpCPUs include reclaim pool in NUMAs without NUMA_binding cpus
884882
rampUpCPUs := machineState.GetFilteredAvailableCPUSet(p.reservedCPUs,
885883
nil, state.CheckDedicatedNUMABinding).
886884
Difference(unionDedicatedIsolatedCPUSet).
887-
Difference(sharedBindingNUMACPUs).
888-
Union(poolsCPUSet[state.PoolNameReclaim])
885+
Difference(sharedBindingNUMACPUs)
889886

890887
rampUpCPUsTopologyAwareAssignments, err := machine.GetNumaAwareAssignments(p.machineInfo.CPUTopology, rampUpCPUs)
891888
if err != nil {

0 commit comments

Comments
 (0)