aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2021-10-19 14:35:37 +0200
committerPeter Zijlstra <peterz@infradead.org>2021-10-31 11:11:38 +0100
commit8ea9183db4ad8afbcb7089a77c23eaf965b0cacd (patch)
treefb529629b90f7ff58c6ce7571adfae771a2ca5cd /kernel
parentsched/fair: Remove sysctl_sched_migration_cost condition (diff)
downloadlinux-dev-8ea9183db4ad8afbcb7089a77c23eaf965b0cacd.tar.xz
linux-dev-8ea9183db4ad8afbcb7089a77c23eaf965b0cacd.zip
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
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 57eae0ebc492..13950beb01a2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -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) {
@@ -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.