Skip to content

Commit

Permalink
koord-scheduler: tweak cpu amplification ratio parse
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Zhu <[email protected]>
  • Loading branch information
zqzten committed Sep 24, 2023
1 parent b9bf498 commit 71905d7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/scheduler/plugins/nodenumaresource/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ const (
)

const (
ErrNotFoundCPUTopology = "node(s) CPU Topology not found"
ErrInvalidCPUTopology = "node(s) invalid CPU Topology"
ErrSMTAlignmentError = "node(s) requested cpus not multiple cpus per core"
ErrRequiredFullPCPUsPolicy = "node(s) required FullPCPUs policy"
ErrInsufficientAmplifiedCPU = "Insufficient amplified cpu"
ErrNotFoundCPUTopology = "node(s) CPU Topology not found"
ErrInvalidCPUTopology = "node(s) invalid CPU Topology"
ErrSMTAlignmentError = "node(s) requested cpus not multiple cpus per core"
ErrRequiredFullPCPUsPolicy = "node(s) required FullPCPUs policy"
ErrInvalidCPUAmplificationRatio = "node(s) invalid CPU amplification ratio"
ErrInsufficientAmplifiedCPU = "Insufficient amplified cpu"
)

var (
Expand Down Expand Up @@ -330,11 +331,10 @@ func (p *Plugin) filterAmplifiedCPUs(state *preFilterState, nodeInfo *framework.
}

node := nodeInfo.Node()
ratios, err := extension.GetNodeResourceAmplificationRatios(node.Annotations)
cpuAmplificationRatio, err := extension.GetNodeResourceAmplificationRatio(node.Annotations, corev1.ResourceCPU)
if err != nil {
return framework.NewStatus(framework.UnschedulableAndUnresolvable, "node(s) invalid amplification ratios")
return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrInvalidCPUAmplificationRatio)
}
cpuAmplificationRatio := ratios[corev1.ResourceCPU]
if cpuAmplificationRatio <= 1 {
return nil
}
Expand Down

0 comments on commit 71905d7

Please sign in to comment.