[PATCH v5 10/24] sched/core: Keep tick on non-preferred CPUs until tasks are out
From: Shrikanth Hegde
Date: Thu Jun 25 2026 - 08:53:57 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>
---
v4->v5:
- Move it below rt checks. (Sashiko)
kernel/sched/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 281715a6e88f..c0391e7897f5 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1473,6 +1473,10 @@ bool sched_can_stop_tick(struct rq *rq)
return false;
}
+ /* Keep the tick running until CFS tasks are pushed out*/
+ if (!cpu_preferred(rq->cpu) && rq->cfs.h_nr_queued)
+ return false;
+
return true;
}
#endif /* CONFIG_NO_HZ_FULL */
--
2.47.3