[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <873449g79w.ffs@tglx>
Date: Tue, 13 Jan 2026 11:02:19 +0100
From: Thomas Gleixner <tglx@...nel.org>
To: "Ionut Nechita (Sunlight Linux)" <sunlightlinux@...il.com>, Frederic
Weisbecker <frederic@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Anna-Maria Behnsen <anna-maria@...utronix.de>, Ionut Nechita
<ionut_n2001@...oo.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] tick/nohz: Add fast-path tick stopping for idle
isolated cores
On Tue, Jan 06 2026 at 17:36, Ionut Nechita wrote:
> From: Ionut Nechita <ionut_n2001@...oo.com>
>
> 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(¤t->tick_dep_mask);
> + prefetch(¤t->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(¤t->tick_dep_mask) &&
> + !atomic_read(¤t->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;
Powered by blists - more mailing lists