From: Frederic Weisbecker <frederic@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Christian Loehle <christian.loehle@arm.com>
Subject: Re: [PATCH v1 3/3] cpuidle: governors: menu: Special-case nohz_full CPUs
Date: Thu, 18 Sep 2025 17:07:36 +0200 [thread overview]
Message-ID: <aMwgOJc6Hq17uFzj@localhost.localdomain> (raw)
In-Reply-To: <CAJZ5v0h3eWw3B15SamchCVWfxfEEbOOgjm4ZbmkTt9ijZvvHMA@mail.gmail.com>
Le Thu, Sep 11, 2025 at 07:07:42PM +0200, Rafael J. Wysocki a écrit :
> On Thu, Sep 11, 2025 at 4:17 PM Frederic Weisbecker <frederic@kernel.org> wrote:
> > So, when !tick_nohz_full_cpu(dev->cpu), what is the purpose of this tick stopped
> > special case?
> >
> > Is it because the next dynamic tick is a better prediction than the typical
> > interval once the tick is stopped?
>
> When !tick_nohz_full_cpu(dev->cpu), the tick is a safety net against
> getting stuck in a shallow idle state for too long. In that case, if
> the tick is stopped, the safety net is not there and it is better to
> use a deep state.
Right.
> However, data->next_timer_ns is a lower limit for the idle state
> target residency because this is when the next timer is going to
> trigger.
Ok.
>
> > Does that mean we might become more "pessimistic" concerning the predicted idle
> > time for nohz_full CPUs?
>
> Yes, and not just we might, but we do unless the idle periods in the
> workload are "long".
Ok.
>
> > I guess too shallow C-states are still better than too deep but there should be
> > a word about that introduced side effect (if any).
>
> Yeah, I agree.
>
> That said, on a nohz_full CPU there is no safety net against getting
> stuck in a shallow idle state because the tick is not present. That's
> why currently the governors don't allow shallow states to be used on
> nohz_full CPUs.
>
> The lack of a safety net is generally not a problem when the CPU has
> been isolated to run something doing real work all the time, with
> possible idle periods in the workload, but there are people who
> isolate CPUs for energy-saving reasons and don't run anything on them
> on purpose. For those folks, the current behavior to select deep idle
> states every time is actually desirable.
So far I haven't heard from anybody using nohz_full for powersavings. If
you have I'd be curious about it. Whether a task runs tickless or not, it
still runs and the CPU isn't sleeping. Also CPU 0 stays periodic on nohz_full,
which alone is a problem for powersaving but also prevents a whole package
from entering low power mode on NUMA.
Let's say it not optimized toward powersaving...
> So there are two use cases that cannot be addressed at once and I'm
> thinking about adding a control knob to allow the user to decide which
> way to go.
I'm tempted to say we should focus on having not too deep states,
at the expense of having too shallow. Of course I'm not entirely
comfortable with the idea because nohz_full CPUs may be idle for a while
on some workloads. And everyone deserves a rest at some point after
a long day.
I guess force restarting the tick upon idle entry would probably be
bad for tiny idle round-trips?
As for such a knob, I'm not sure anybody would use it.
Thanks.
--
Frederic Weisbecker
SUSE Labs
next prev parent reply other threads:[~2025-09-18 15:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 10:21 [PATCH v1 0/3] cpuidle: governors: menu: A fix, a corner case adjustment and a cleanup Rafael J. Wysocki
2025-08-13 10:25 ` [PATCH v1 1/3] cpuidle: governors: menu: Avoid selecting states with too much latency Rafael J. Wysocki
2025-08-13 19:13 ` Christian Loehle
2025-08-18 17:08 ` Rafael J. Wysocki
2025-09-11 13:37 ` Frederic Weisbecker
2025-10-23 3:05 ` Doug Smythies
2025-10-23 14:51 ` Rafael J. Wysocki
2025-10-23 16:02 ` Doug Smythies
2025-10-23 16:52 ` Rafael J. Wysocki
2025-08-13 10:26 ` [PATCH v1 2/3] cpuidle: governors: menu: Rearrange main loop in menu_select() Rafael J. Wysocki
2025-08-14 13:00 ` Christian Loehle
2025-09-11 13:37 ` Frederic Weisbecker
2025-08-13 10:29 ` [PATCH v1 3/3] cpuidle: governors: menu: Special-case nohz_full CPUs Rafael J. Wysocki
2025-08-14 14:09 ` Christian Loehle
2025-08-18 17:41 ` Rafael J. Wysocki
2025-08-19 9:10 ` Christian Loehle
2025-08-19 11:56 ` Rafael J. Wysocki
2025-09-11 14:17 ` Frederic Weisbecker
2025-09-11 17:07 ` Rafael J. Wysocki
2025-09-18 15:07 ` Frederic Weisbecker [this message]
2025-09-23 17:25 ` Rafael J. Wysocki
2026-02-08 15:59 ` Ionut Nechita (Wind River)
2026-02-20 13:02 ` Rafael J. Wysocki
2025-08-28 20:16 ` [PATCH v1] cpuidle: governors: teo: " Rafael J. Wysocki
2025-08-29 19:37 ` Rafael J. Wysocki
2025-08-31 21:30 ` Christian Loehle
2025-09-01 19:08 ` Rafael J. Wysocki
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=aMwgOJc6Hq17uFzj@localhost.localdomain \
--to=frederic@kernel.org \
--cc=christian.loehle@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
/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