From: Christian Loehle <christian.loehle@arm.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Aboorva Devarajan <aboorvad@linux.ibm.com>
Subject: Re: [PATCH v1 1/2] cpuidle: governors: teo: Fix tick_intercepts handling in teo_update()
Date: Mon, 17 Nov 2025 09:06:10 +0000 [thread overview]
Message-ID: <8a9482f3-d8f4-4dcf-b7eb-51a2e1bd4d3b@arm.com> (raw)
In-Reply-To: <5085160.31r3eYUQgx@rafael.j.wysocki>
On 11/16/25 12:34, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The condition deciding whether or not to increase cpu_data->tick_intercepts
> in teo_update() is reverse, so fix it.
>
> Fixes: d619b5cc6780 ("cpuidle: teo: Simplify counting events used for tick management")
> Cc: All applicable <stable@vger.kernel.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> I'm planning to apply this for 6.19 on top of
>
> https://lore.kernel.org/linux-pm/6228387.lOV4Wx5bFT@rafael.j.wysocki/
>
> because that patch (indirectly) depends on commit d619b5cc6780.
>
> ---
> drivers/cpuidle/governors/teo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/cpuidle/governors/teo.c
> +++ b/drivers/cpuidle/governors/teo.c
> @@ -251,7 +251,7 @@ static void teo_update(struct cpuidle_dr
> cpu_data->state_bins[idx_timer].hits += PULSE;
> } else {
> cpu_data->state_bins[idx_duration].intercepts += PULSE;
> - if (TICK_NSEC <= measured_ns)
> + if (measured_ns <= TICK_NSEC)
nit: Why <= instead of <?
I guess it really doesn't matter with measured_ns only being a rough approximation
with an error in the order of wakeup-latency.
Reviewed-by:
Christian Loehle <christian.loehle@arm.com>
Let me go write some tests for all these edge cases :/
IIRC Aboorva's power systems have no idle state deeper than TICK_NSEC, so
this might make a big difference here, hence CCed.
next prev parent reply other threads:[~2025-11-17 9:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-16 12:31 [PATCH v1 0/2] cpuidle: governors: teo: Fix and simplification Rafael J. Wysocki
2025-11-16 12:34 ` [PATCH v1 1/2] cpuidle: governors: teo: Fix tick_intercepts handling in teo_update() Rafael J. Wysocki
2025-11-17 9:06 ` Christian Loehle [this message]
2025-11-17 16:15 ` Rafael J. Wysocki
2025-11-16 12:35 ` [PATCH v1 2/2] cpuidle: governors: teo: Simplify intercepts-based state lookup Rafael J. Wysocki
2025-11-19 21:13 ` Rafael J. Wysocki
2025-11-20 8:45 ` Christian Loehle
2025-11-20 11:07 ` Rafael J. Wysocki
2025-11-28 23:45 ` [PATCH v1 0/2] cpuidle: governors: teo: Fix and simplification Christian Loehle
2025-12-02 17:54 ` Doug Smythies
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=8a9482f3-d8f4-4dcf-b7eb-51a2e1bd4d3b@arm.com \
--to=christian.loehle@arm.com \
--cc=aboorvad@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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