Skip to content
Snippets Groups Projects
Commit 7dad97ba authored by Vincent Guittot's avatar Vincent Guittot Committed by Yang Yingliang
Browse files

sched/fair: Fix NOHZ next idle balance


stable inclusion
from linux-4.19.140
commit 519252e38ca1e1d614b11f982b1f489d62c135ee

--------------------------------

[ Upstream commit 3ea2f097 ]

With commit:
  'b7031a02 ("sched/fair: Add NOHZ_STATS_KICK")'
rebalance_domains of the local cfs_rq happens before others idle cpus have
updated nohz.next_balance and its value is overwritten.

Move the update of nohz.next_balance for other idles cpus before balancing
and updating the next_balance of local cfs_rq.

Also, the nohz.next_balance is now updated only if all idle cpus got a
chance to rebalance their domains and the idle balance has not been aborted
because of new activities on the CPU. In case of need_resched, the idle
load balance will be kick the next jiffie in order to address remaining
ilb.

Fixes: b7031a02 ("sched/fair: Add NOHZ_STATS_KICK")
Reported-by: default avatarPeng Liu <iwtbavbm@gmail.com>
Signed-off-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
Acked-by: default avatarMel Gorman <mgorman@suse.de>
Link: https://lkml.kernel.org/r/20200609123748.18636-1-vincent.guittot@linaro.org


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 9f6e50a6
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment