Skip to content

Commit c1f43c3

Browse files
vingu-linaroPeter Zijlstra
authored andcommitted
sched/fair: Fix sched_can_stop_tick() for fair tasks
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: 11cc374 ("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
1 parent 493afbd commit c1f43c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ bool sched_can_stop_tick(struct rq *rq)
13411341
if (scx_enabled() && !scx_can_stop_tick(rq))
13421342
return false;
13431343

1344-
if (rq->cfs.nr_running > 1)
1344+
if (rq->cfs.h_nr_running > 1)
13451345
return false;
13461346

13471347
/*

0 commit comments

Comments
 (0)