Skip to content

Commit f9b650b

Browse files
committed
Scheduler: execute PreScore right before Score instead of after Filter.
1 parent 0641e0c commit f9b650b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/scheduler/core/generic_scheduler.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
166166
}
167167

168168
// Run "prefilter" plugins.
169+
startPredicateEvalTime := time.Now()
169170
preFilterStatus := prof.RunPreFilterPlugins(ctx, state, pod)
170171
if !preFilterStatus.IsSuccess() {
171172
return result, preFilterStatus.AsError()
172173
}
173174
trace.Step("Running prefilter plugins done")
174175

175-
startPredicateEvalTime := time.Now()
176176
filteredNodes, filteredNodesStatuses, err := g.findNodesThatFitPod(ctx, prof, state, pod)
177177
if err != nil {
178178
return result, err
@@ -187,13 +187,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
187187
}
188188
}
189189

190-
// Run "prescore" plugins.
191-
prescoreStatus := prof.RunPreScorePlugins(ctx, state, pod, filteredNodes)
192-
if !prescoreStatus.IsSuccess() {
193-
return result, prescoreStatus.AsError()
194-
}
195-
trace.Step("Running prescore plugins done")
196-
197190
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
198191
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
199192

@@ -208,6 +201,13 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
208201
}, nil
209202
}
210203

204+
// Run "prescore" plugins.
205+
prescoreStatus := prof.RunPreScorePlugins(ctx, state, pod, filteredNodes)
206+
if !prescoreStatus.IsSuccess() {
207+
return result, prescoreStatus.AsError()
208+
}
209+
trace.Step("Running prescore plugins done")
210+
211211
priorityList, err := g.prioritizeNodes(ctx, prof, state, pod, filteredNodes)
212212
if err != nil {
213213
return result, err

0 commit comments

Comments
 (0)