sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list
authorVincent Guittot <vincent.guittot@linaro.org>
Thu, 3 Dec 2020 00:44:23 +0000 (19:44 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Dec 2020 09:40:24 +0000 (10:40 +0100)
commit294de8933adbdda78acaa3935971d26bb6de745e
treea3cb2aa2825efbac8b52c312f65673401201ced7
parentc4405cdf96f4b98898f556069154b535aeefb965
sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list

[ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 ]

Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
are quite close and follow the same sequence for enqueuing an entity in the
cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
enqueue_task_fair(). This fixes a problem already faced with the latter and
add an optimization in the last for_each_sched_entity loop.

Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Reviewed-by: Ben Segall <bsegall@google.com>
Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/fair.c