Linux Power Management development
 help / color / mirror / Atom feed
From: Qais Yousef <qyousef@layalina.io>
To: Christian Loehle <christian.loehle@arm.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [patch 2/2] sched/idle: Make default_idle_call() NOHZ aware
Date: Tue, 10 Mar 2026 15:03:47 +0000	[thread overview]
Message-ID: <20260310150347.ji2fdpdvw6txspc4@airbuntu> (raw)
In-Reply-To: <f11fc45d-314a-4e2d-bcd1-9d8b1a49c87a@arm.com>

On 03/10/26 09:18, Christian Loehle wrote:
> On 3/10/26 03:54, Qais Yousef wrote:
> > On 03/07/26 17:25, Rafael J. Wysocki wrote:
> > 
> >> In the meantime I realized that if the .select() governor
> >> callback is skipped, its .reflect() callback should be skipped
> >> either, so I've posted this:
> >>
> >> https://lkml.org/lkml/2026/3/7/569
> >>
> >> and here's a fixed version of the last patch on top of the above (for
> >> completeness):
> >>
> >> ---
> >>  kernel/sched/idle.c |   25 ++++++++++++++++---------
> >>  1 file changed, 16 insertions(+), 9 deletions(-)
> >>
> >> --- a/kernel/sched/idle.c
> >> +++ b/kernel/sched/idle.c
> >> @@ -161,6 +161,14 @@ static int call_cpuidle(struct cpuidle_d
> >>  	return cpuidle_enter(drv, dev, next_state);
> >>  }
> >>  
> >> +static void idle_call_stop_or_retain_tick(bool stop_tick)
> >> +{
> >> +	if (stop_tick || tick_nohz_tick_stopped())
> >> +		tick_nohz_idle_stop_tick();
> >> +	else
> >> +		tick_nohz_idle_retain_tick();
> >> +}
> >> +
> >>  /**
> >>   * cpuidle_idle_call - the main idle function
> >>   *
> >> @@ -170,7 +178,7 @@ static int call_cpuidle(struct cpuidle_d
> >>   * set, and it returns with polling set.  If it ever stops polling, it
> >>   * must clear the polling bit.
> >>   */
> >> -static void cpuidle_idle_call(void)
> >> +static void cpuidle_idle_call(bool stop_tick)
> >>  {
> >>  	struct cpuidle_device *dev = cpuidle_get_device();
> >>  	struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
> >> @@ -186,7 +194,7 @@ static void cpuidle_idle_call(void)
> >>  	}
> >>  
> >>  	if (cpuidle_not_available(drv, dev)) {
> >> -		tick_nohz_idle_stop_tick();
> >> +		idle_call_stop_or_retain_tick(stop_tick);
> >>  
> >>  		default_idle_call();
> >>  		goto exit_idle;
> >> @@ -222,17 +230,14 @@ static void cpuidle_idle_call(void)
> >>  		next_state = cpuidle_find_deepest_state(drv, dev, max_latency_ns);
> >>  		call_cpuidle(drv, dev, next_state);
> >>  	} else if (drv->state_count > 1) {
> >> -		bool stop_tick = true;
> >> +		stop_tick = true;
> > 
> > Silly question, but wouldn't this benefit the normal path too to delay for one
> > tick? This will only matter for the cases where the governor doesn't explicitly
> > set stop_tick to either true or false - which I am not sure what they are :)
> > 
> Right now the governors will always set stop_tick explicitly (and overriding
> that might confuse the governor-internal state).

So we can drop this hunk then

  reply	other threads:[~2026-03-10 15:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260301191959.406218221@kernel.org>
     [not found] ` <CAJZ5v0h-bGU34d9OnhYqdzz+5UiKV1rBEB9NS-TL4=sK2jf-LQ@mail.gmail.com>
     [not found]   ` <20260304030306.uk5c63xw4oqvjffb@airbuntu>
2026-03-06 21:21     ` [patch 2/2] sched/idle: Make default_idle_call() NOHZ aware Rafael J. Wysocki
2026-03-06 21:31       ` Rafael J. Wysocki
2026-03-07 16:25         ` Rafael J. Wysocki
2026-03-10  3:54           ` Qais Yousef
2026-03-10  9:18             ` Christian Loehle
2026-03-10 15:03               ` Qais Yousef [this message]
2026-03-10 15:09                 ` Rafael J. Wysocki
2026-03-10 15:14                   ` Qais Yousef
2026-03-07 16:12     ` [PATCH v1] sched: idle: Make skipping governor callbacks more consistent Rafael J. Wysocki
2026-03-09  9:13       ` Christian Loehle
2026-03-09 12:26         ` Rafael J. Wysocki
2026-03-10  3:57           ` Qais Yousef
2026-03-09 12:44       ` Aboorva Devarajan
2026-03-10 14:28       ` Frederic Weisbecker

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=20260310150347.ji2fdpdvw6txspc4@airbuntu \
    --to=qyousef@layalina.io \
    --cc=christian.loehle@arm.com \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=tglx@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