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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Dietmar Eggemann <[email protected]> Acked-by: Mel Gorman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c5b0a7e commit 8ea9183

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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)