Skip to content

Commit

Permalink
sched/fair: Cleanup newidle_balance
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
vingu-linaro authored and Peter Zijlstra committed Oct 31, 2021
1 parent c5b0a7e commit 8ea9183
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -10916,10 +10916,10 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
int continue_balancing = 1;
u64 domain_cost;

if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost) {
update_next_balance(sd, &next_balance);
update_next_balance(sd, &next_balance);

if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost)
break;
}

if (sd->flags & SD_BALANCE_NEWIDLE) {

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

update_next_balance(sd, &next_balance);

/*
* Stop searching for tasks to pull if there are
* now runnable tasks on this rq.
Expand Down

0 comments on commit 8ea9183

Please sign in to comment.