public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ionut Nechita (Sunlight Linux)" <sunlightlinux@gmail.com>
To: frederic@kernel.org
Cc: anna-maria@linutronix.de, ionut_n2001@yahoo.com,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	sunlightlinux@gmail.com, tglx@linutronix.de
Subject: Re: [PATCH 1/1] tick/nohz: Add fast-path tick stopping for idle isolated cores
Date: Wed, 28 Jan 2026 09:26:57 +0200	[thread overview]
Message-ID: <20260128072658.6925-2-sunlightlinux@gmail.com> (raw)
In-Reply-To: <aXjAOBKr6tbShb8C@localhost.localdomain>

On Tue, Jan 27, 2026 at 02:40:08PM +0100, Frederic Weisbecker wrote:
> Le Tue, Jan 06, 2026 at 05:36:48PM +0200, Ionut Nechita (Sunlight Linux) a écrit :
> > 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
> > immediately allow the tick to stop.
>
> Most of the idle code is under TS_FLAG_INIDLE, and the can_stop_full_tick()
> path is then not taken.

You're absolutely right about the TS_FLAG_INIDLE observation. Looking at
tick_nohz_irq_exit(), when TS_FLAG_INIDLE is set, the code path goes to
tick_nohz_start_idle() and can_stop_full_tick() is not called at all.

I need to clarify: the benchmark results showing the reduction from 8K to
<500 LOC interrupts were measured with *workloads running* on the isolated
CPUs, not with idle CPUs. The optimization was helping in the non-idle path
where can_stop_full_tick() is actually called via tick_nohz_full_update_tick().

The commit message was misleading by focusing on "idle isolated cores" when
the actual benefit was for nohz_full CPUs running workloads.

> I guess we could indeed optimize further outside the idle path. But I'm not
> sure this is a good thing. After all, the point of nohz_full is to run things
> with the tick stopped. The only part that should run with the tick is setup
> and preparatory work, which doesn't really needs optimization.

Thomas suggested a cleaner approach that optimizes check_tick_dependency()
directly by returning early when tracepoints are disabled:

    if (likely(!tracepoint_enabled(tick_stop)))
        return !val;

This is more general and benefits all contexts, not just nohz_full. It avoids
the per-bit iteration when tracing is disabled, which is the common case.

Thanks for pointing out the idle path issue - it helped clarify where the
actual optimization was occurring.

Thanks,
Ionut

      reply	other threads:[~2026-01-28  7:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-06 15:36 [PATCH 0/1] tick/nohz: Optimize tick stopping for isolated cores Ionut Nechita (Sunlight Linux)
2026-01-06 15:36 ` [PATCH 1/1] tick/nohz: Add fast-path tick stopping for idle " Ionut Nechita (Sunlight Linux)
2026-01-13 10:02   ` Thomas Gleixner
2026-01-26 19:31     ` Ionut Nechita (Sunlight Linux)
2026-01-26 21:32       ` Thomas Gleixner
2026-01-27 13:40   ` Frederic Weisbecker
2026-01-28  7:26     ` Ionut Nechita (Sunlight Linux) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260128072658.6925-2-sunlightlinux@gmail.com \
    --to=sunlightlinux@gmail.com \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=ionut_n2001@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox