aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2018-04-26 06:19:32 -0400
committerIngo Molnar <mingo@kernel.org>2018-05-03 01:38:03 -0400
commit457be908c83637ee10bda085a23dc05afa3b14a0 (patch)
treee578083954eca7d085ad6428ca5ddc140657c40a
parent0b26351b910fb8fe6a056f8a1bbccabe50c0e19f (diff)
sched/fair: Fix the update of blocked load when newly idle
With commit: 31e77c93e432 ("sched/fair: Update blocked load when newly idle") ... we release the rq->lock when updating blocked load of idle CPUs. This opens a time window during which another CPU can add a task to this CPU's cfs_rq. The check for newly added task of idle_balance() is not in the common path. Move the out label to include this check. Reported-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: 31e77c93e432 ("sched/fair: Update blocked load when newly idle") Link: http://lkml.kernel.org/r/20180426103133.GA6953@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/fair.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 54dc31e7ab9b..e3002e5ada31 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9847,6 +9847,7 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf)
9847 if (curr_cost > this_rq->max_idle_balance_cost) 9847 if (curr_cost > this_rq->max_idle_balance_cost)
9848 this_rq->max_idle_balance_cost = curr_cost; 9848 this_rq->max_idle_balance_cost = curr_cost;
9849 9849
9850out:
9850 /* 9851 /*
9851 * While browsing the domains, we released the rq lock, a task could 9852 * While browsing the domains, we released the rq lock, a task could
9852 * have been enqueued in the meantime. Since we're not going idle, 9853 * have been enqueued in the meantime. Since we're not going idle,
@@ -9855,7 +9856,6 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf)
9855 if (this_rq->cfs.h_nr_running && !pulled_task) 9856 if (this_rq->cfs.h_nr_running && !pulled_task)
9856 pulled_task = 1; 9857 pulled_task = 1;
9857 9858
9858out:
9859 /* Move the next balance forward */ 9859 /* Move the next balance forward */
9860 if (time_after(this_rq->next_balance, next_balance)) 9860 if (time_after(this_rq->next_balance, next_balance))
9861 this_rq->next_balance = next_balance; 9861 this_rq->next_balance = next_balance;