Re: [PATCH 1/1] tick/nohz: Add fast-path tick stopping for idle isolated cores

From: Thomas Gleixner

Date: Tue Jan 13 2026 - 05:02:23 EST


On Tue, Jan 06 2026 at 17:36, Ionut Nechita wrote:
> From: Ionut Nechita <ionut_n2001@xxxxxxxxx>
>
> When a CPU is configured as nohz_full and is running the idle task with
> no tick dependencies, we can skip expensive dependency checks and

s/we can/it is possible to/

> immediately allow the tick to stop. This significantly reduces timer
> interrupts on properly isolated cores.
>
> The patch adds:

"The patch adds" is a pointless filler phrase. See

Documentation/process/

> + /*
> + * Prefetch dependency structures for better cache locality
> + */
> + prefetch(&tick_dep_mask);
> + prefetch(&ts->tick_dep_mask);
> + prefetch(&current->tick_dep_mask);
> + prefetch(&current->signal->tick_dep_mask);

These are really not required.

> + /*
> + * Fast path for idle isolated cores: if this is an isolated CPU
> + * running the idle task with no dependencies, we can skip expensive
> + * checks and immediately allow tick to stop. This significantly
> + * reduces timer interrupts on properly isolated cores.
> + */
> + if (tick_nohz_full_cpu(cpu) &&
> + is_idle_task(current) &&
> + !atomic_read(&tick_dep_mask) &&
> + !atomic_read(&ts->tick_dep_mask) &&
> + !atomic_read(&current->tick_dep_mask) &&
> + !atomic_read(&current->signal->tick_dep_mask)) {
> + return true;

How is that different from the existing checks for the various
dependency masks, except for the added nohz_full_cpu() and
is_idle_task() conditions?

I can see that not going through the per bit checks is faster, but I
really do not see how this reduces the timer interrupts by an order of
magnitude. At least not without a proper explanation why this matters
and how this optimization is causing this improvement.

Also why is this restricted to tick_nohz_full CPUs and to the idle task?

You can avoid the per bit evaluation way simpler, which improves the
evaluation independent of context. See uncompiled patch below.

Thanks,

tglx
---
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -344,6 +344,9 @@ static bool check_tick_dependency(atomic
{
int val = atomic_read(dep);

+ if (likely(!tracepoint_enabled(tick_stop)))
+ return !val;
+
if (val & TICK_DEP_MASK_POSIX_TIMER) {
trace_tick_stop(0, TICK_DEP_MASK_POSIX_TIMER);
return true;