[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a61647e9-dedd-4053-8f65-126564748950@arm.com>
Date: Thu, 16 Jan 2025 13:27:39 +0000
From: Christian Loehle <christian.loehle@....com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>
Subject: Re: [PATCH v1 2/9] cpuidle: teo: Reorder candidate state index checks
On 1/13/25 18:36, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Since constraint_idx may be 0, the candidate state index may change to 0
> after assigning constraint_idx to it, so first check if it is greater
> than constraint_idx (and update it if so) and then check it against 0.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Fine with me now, since the posted patch addresses my concern.
Reviewed-by: Christian Loehle <christian.loehle@....com>
> ---
>
> This is a rebased variant of
>
> https://lore.kernel.org/linux-pm/8476650.T7Z3S40VBb@rjwysocki.net/
>
> ---
> drivers/cpuidle/governors/teo.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> --- a/drivers/cpuidle/governors/teo.c
> +++ b/drivers/cpuidle/governors/teo.c
> @@ -428,6 +428,14 @@
> break;
> }
> }
> +
> + /*
> + * If there is a latency constraint, it may be necessary to select an
> + * idle state shallower than the current candidate one.
> + */
> + if (idx > constraint_idx)
> + idx = constraint_idx;
> +
> if (!idx && prev_intercept_idx) {
> /*
> * We have to query the sleep length here otherwise we don't
> @@ -439,13 +447,6 @@
> }
>
> /*
> - * If there is a latency constraint, it may be necessary to select an
> - * idle state shallower than the current candidate one.
> - */
> - if (idx > constraint_idx)
> - idx = constraint_idx;
> -
> - /*
> * Skip the timers check if state 0 is the current candidate one,
> * because an immediate non-timer wakeup is expected in that case.
> */
>
>
>
Powered by blists - more mailing lists