Skip to content

Commit

Permalink
koord-scheduler: NodeNUMAResource do fallback scoring with zero cpu r…
Browse files Browse the repository at this point in the history
…equest

Signed-off-by: Zach Zhu <[email protected]>
  • Loading branch information
zqzten committed Sep 24, 2023
1 parent 71905d7 commit 6a20b87
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/scheduler/plugins/nodenumaresource/scoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,15 @@ func (p *Plugin) Score(ctx context.Context, cycleState *framework.CycleState, po
}

func (p *Plugin) scoreWithAmplifiedCPUs(cycleState *framework.CycleState, state *preFilterState, pod *corev1.Pod, nodeInfo *framework.NodeInfo, topologyOptions TopologyOptions) (int64, *framework.Status) {
quantity := state.requests[corev1.ResourceCPU]
if quantity.IsZero() {
return 0, nil
}

node := nodeInfo.Node()
resourceOptions, err := p.getResourceOptions(cycleState, state, node, pod, topologymanager.NUMATopologyHint{}, topologyOptions)
if err != nil {
return 0, nil
}

quantity := state.requests[corev1.ResourceCPU]
cpuAmplificationRatio := resourceOptions.topologyOptions.AmplificationRatios[corev1.ResourceCPU]
if cpuAmplificationRatio <= 1 {
if quantity.IsZero() || cpuAmplificationRatio <= 1 {
return p.scorer.score(nodeInfo.Requested, nodeInfo.Allocatable, framework.NewResource(resourceOptions.requests))
}

Expand Down

0 comments on commit 6a20b87

Please sign in to comment.