diff --git a/kernel/sched/walt/walt_cfs.c b/kernel/sched/walt/walt_cfs.c index f667f0fcf8ac..20cd6e800d69 100644 --- a/kernel/sched/walt/walt_cfs.c +++ b/kernel/sched/walt/walt_cfs.c @@ -263,13 +263,6 @@ static void walt_find_best_target(struct sched_domain *sd, if (new_util > capacity_orig) continue; - /* - * Pre-compute the maximum possible capacity we expect - * to have available on this CPU once the task is - * enqueued here. - */ - spare_cap = capacity_orig - new_util; - /* * Find an optimal backup IDLE CPU for non latency * sensitive tasks. @@ -313,6 +306,13 @@ static void walt_find_best_target(struct sched_domain *sd, continue; } + /* + * Compute the maximum possible capacity we expect + * to have available on this CPU once the task is + * enqueued here. + */ + spare_cap = capacity_orig - new_util; + /* * Try to spread the rtg high prio tasks so that they * don't preempt each other. This is a optimisitc