[PATCH v4 09/20] sched/core: Keep tick on non-preferred CPUs until tasks are out
From: Shrikanth Hegde
Date: Wed Jun 17 2026 - 13:45:22 EST
Enable tick on nohz full CPU when it is marked as non-preferred.
If there in no CFS running there, disable the tick to save the power.
Steal time handling code will call tick_nohz_dep_set_cpu with
TICK_DEP_BIT_SCHED for moving the task out of nohz_full CPU fast.
Signed-off-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
---
kernel/sched/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 714816cfa975..390a4de28b3c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1431,6 +1431,10 @@ bool sched_can_stop_tick(struct rq *rq)
if (rq->dl.dl_nr_running)
return false;
+ /* Keep the tick running until CFS tasks are pushed out*/
+ if (!cpu_preferred(rq->cpu) && rq->cfs.h_nr_queued)
+ return false;
+
/*
* If there are more than one RR tasks, we need the tick to affect the
* actual RR behaviour.
--
2.47.3