Skip to content

Commit efaf4f3

Browse files
authored
Merge pull request kubernetes#75507 from hex108/skip
Avoid unnecessary sort for some cases in selectVictimsOnNode
2 parents dfe2e0e + 2755373 commit efaf4f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/scheduler/core/generic_scheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,6 @@ func selectVictimsOnNode(
10701070
removePod(p)
10711071
}
10721072
}
1073-
potentialVictims.Sort()
10741073
// If the new pod does not fit after removing all the lower priority pods,
10751074
// we are almost done and this node is not suitable for preemption. The only
10761075
// condition that we could check is if the "pod" is failing to schedule due to
@@ -1085,6 +1084,7 @@ func selectVictimsOnNode(
10851084
}
10861085
var victims []*v1.Pod
10871086
numViolatingVictim := 0
1087+
potentialVictims.Sort()
10881088
// Try to reprieve as many pods as possible. We first try to reprieve the PDB
10891089
// violating victims and then other non-violating ones. In both cases, we start
10901090
// from the highest priority victims.

0 commit comments

Comments
 (0)