]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched/fair: Fix sched_can_stop_tick() for fair tasks
authorVincent Guittot <vincent.guittot@linaro.org>
Mon, 2 Dec 2024 17:45:56 +0000 (18:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:01:58 +0000 (14:01 +0100)
commit0ee98301f1f026e9f0abc60bbf91aadb738456a2
treecb07e788f2988a36e738ffd50521c9a89b69b3d7
parent5dbe6816c49197677a5ecce749bd99929da147da
sched/fair: Fix sched_can_stop_tick() for fair tasks

[ Upstream commit c1f43c342e1f2e32f0620bf2e972e2a9ea0a1e60 ]

We can't stop the tick of a rq if there are at least 2 tasks enqueued in
the whole hierarchy and not only at the root cfs rq.

rq->cfs.nr_running tracks the number of sched_entity at one level
whereas rq->cfs.h_nr_running tracks all queued tasks in the
hierarchy.

Fixes: 11cc374f4643b ("sched_ext: Simplify scx_can_stop_tick() invocation in sched_can_stop_tick()")
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>
Link: https://lore.kernel.org/r/20241202174606.4074512-2-vincent.guittot@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/core.c