[PATCH 2/3] sched/tick: Move TICK_NSEC users to PTICK_NSEC
From: Qais Yousef
Date: Sun May 17 2026 - 00:08:59 EST
Leave users in cputime.c and numa related load balance hooked to actual
TICK_NSEC. But the remainder of the references in kernel/sched were
converted to PTICK_NSEC.
Signed-off-by: Qais Yousef <qyousef@xxxxxxxxxxx>
---
kernel/sched/clock.c | 4 ++--
kernel/sched/cpufreq_schedutil.c | 2 +-
kernel/sched/fair.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index 2ae4fbf13431..a331d9f47107 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -282,13 +282,13 @@ static __always_inline u64 sched_clock_local(struct sched_clock_data *scd)
/*
* scd->clock = clamp(scd->tick_gtod + delta,
* max(scd->tick_gtod, scd->clock),
- * scd->tick_gtod + TICK_NSEC);
+ * scd->tick_gtod + PTICK_NSEC);
*/
gtod = scd->tick_gtod + __gtod_offset;
clock = gtod + delta;
min_clock = wrap_max(gtod, old_clock);
- max_clock = wrap_max(old_clock, gtod + TICK_NSEC);
+ max_clock = wrap_max(old_clock, gtod + PTICK_NSEC);
clock = wrap_max(clock, min_clock);
clock = wrap_min(clock, max_clock);
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index ae9fd211cec1..d06527cf8d21 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -252,7 +252,7 @@ static bool sugov_iowait_reset(struct sugov_cpu *sg_cpu, u64 time,
s64 delta_ns = time - sg_cpu->last_update;
/* Reset boost only if a tick has elapsed since last request */
- if (delta_ns <= TICK_NSEC)
+ if (delta_ns <= PTICK_NSEC)
return false;
sg_cpu->iowait_boost = set_iowait_boost ? IOWAIT_BOOST_MIN : 0;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 728965851842..2f8ed2eee2d7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -601,7 +601,7 @@ static inline bool entity_before(const struct sched_entity *a,
* and this value should be no more than two lag bounds. Which puts it in the
* general order of:
*
- * (slice + TICK_NSEC) << NICE_0_LOAD_SHIFT
+ * (slice + PTICK_NSEC) << NICE_0_LOAD_SHIFT
*
* which is around 44 bits in size (on 64bit); that is 20 for
* NICE_0_LOAD_SHIFT, another 20 for NSEC_PER_MSEC and then a handful for
@@ -822,7 +822,7 @@ static inline u64 cfs_rq_max_slice(struct cfs_rq *cfs_rq);
* is possible -- by addition/removal/reweight to the tree -- to move V around
* and end up with a larger lag than we started with.
*
- * Limit this to either double the slice length with a minimum of TICK_NSEC
+ * Limit this to either double the slice length with a minimum of PTICK_NSEC
* since that is the timing granularity.
*
* EEVDF gives the following limit for a steady state system:
@@ -831,7 +831,7 @@ static inline u64 cfs_rq_max_slice(struct cfs_rq *cfs_rq);
*/
static s64 entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se, u64 avruntime)
{
- u64 max_slice = cfs_rq_max_slice(cfs_rq) + TICK_NSEC;
+ u64 max_slice = cfs_rq_max_slice(cfs_rq) + PTICK_NSEC;
s64 vlag, limit;
vlag = avruntime - se->vruntime;
--
2.34.1