Skip to content

Commit 8ea9183

Browse files
vingu-linaroPeter Zijlstra
authored andcommitted
sched/fair: Cleanup newidle_balance
update_next_balance() uses sd->last_balance which is not modified by load_balance() so we can merge the 2 calls in one place. No functional change Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Acked-by: Mel Gorman <mgorman@suse.de> Link: https://lore.kernel.org/r/20211019123537.17146-6-vincent.guittot@linaro.org
1 parent c5b0a7e commit 8ea9183

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

kernel/sched/fair.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10916,10 +10916,10 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
1091610916
int continue_balancing = 1;
1091710917
u64 domain_cost;
1091810918

10919-
if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost) {
10920-
update_next_balance(sd, &next_balance);
10919+
update_next_balance(sd, &next_balance);
10920+
10921+
if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost)
1092110922
break;
10922-
}
1092310923

1092410924
if (sd->flags & SD_BALANCE_NEWIDLE) {
1092510925

@@ -10935,8 +10935,6 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
1093510935
t0 = t1;
1093610936
}
1093710937

10938-
update_next_balance(sd, &next_balance);
10939-
1094010938
/*
1094110939
* Stop searching for tasks to pull if there are
1094210940
* now runnable tasks on this rq.

0 commit comments

Comments
 (0)