From 6a20b871c9acca914f2adea335a9a01b20fd67e2 Mon Sep 17 00:00:00 2001 From: Zach Zhu Date: Sun, 24 Sep 2023 23:16:37 +0800 Subject: [PATCH] koord-scheduler: NodeNUMAResource do fallback scoring with zero cpu request Signed-off-by: Zach Zhu --- pkg/scheduler/plugins/nodenumaresource/scoring.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/scheduler/plugins/nodenumaresource/scoring.go b/pkg/scheduler/plugins/nodenumaresource/scoring.go index 934cb0572..c4034bf25 100644 --- a/pkg/scheduler/plugins/nodenumaresource/scoring.go +++ b/pkg/scheduler/plugins/nodenumaresource/scoring.go @@ -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)) }