From: Beata Michalska <beata.michalska@arm.com>
To: Bowen Yu <yubowen8@huawei.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, catalin.marinas@arm.com,
will@kernel.org, ptsm@linux.microsoft.com, linuxarm@huawei.com,
jonathan.cameron@huawei.com, zhanjie9@hisilicon.com,
prime.zeng@hisilicon.com, wanghuiqiang@huawei.com,
xuwei5@huawei.com, zhenglifeng1@huawei.com,
zhangpengjie2@huawei.com
Subject: Re: [PATCH 3/3] arm64: topology: Remove redundant housekeeping_cpu() checks in arch_freq_get_on_cpu
Date: Mon, 10 Nov 2025 18:15:34 +0100 [thread overview]
Message-ID: <aRIdtuWAIen__yZU@arm.com> (raw)
In-Reply-To: <20251104075544.3243606-4-yubowen8@huawei.com>
On Tue, Nov 04, 2025 at 03:55:44PM +0800, Bowen Yu wrote:
> This patch removes redundant !housekeeping_cpu() check since it is
> inherently done when checking jiffies.
>
> Signed-off-by: Bowen Yu <yubowen8@huawei.com>
> ---
> arch/arm64/kernel/topology.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
> index f1370a4a4df9..6981ef3019d3 100644
> --- a/arch/arm64/kernel/topology.c
> +++ b/arch/arm64/kernel/topology.c
> @@ -310,20 +310,13 @@ int arch_freq_get_on_cpu(int cpu)
> * (and thus freq scale), if available, for given policy: this boils
> * down to identifying an active cpu within the same freq domain, if any.
> */
> - if (!housekeeping_cpu(cpu, HK_TYPE_TICK) ||
> - time_is_before_jiffies(last_update + msecs_to_jiffies(AMU_SAMPLE_EXP_MS))) {
> + if (time_is_before_jiffies(last_update + msecs_to_jiffies(AMU_SAMPLE_EXP_MS))) {
> struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
> int ref_cpu;
>
> if (!policy)
> return -EINVAL;
>
> - if (!cpumask_intersects(policy->related_cpus,
> - housekeeping_cpumask(HK_TYPE_TICK))) {
> - cpufreq_cpu_put(policy);
> - return -EOPNOTSUPP;
> - }
Removing this means you will iterate over potentially dynamic-tick CPUs and
running the checks instead of skipping it here (plus other implications).
Is that intentional ?
---
BR
Beata
> -
> for_each_cpu_wrap(ref_cpu, policy->cpus, cpu + 1) {
> if (ref_cpu == start_cpu) {
> /* Prevent verifying same CPU twice */
> --
> 2.33.0
>
prev parent reply other threads:[~2025-11-10 17:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 7:55 [PATCH 0/3] arm64: topology: Improve cpuinfo_avg_freq for ARM64 Bowen Yu
2025-11-04 7:55 ` [PATCH 1/3] arm64: topology: Improve AMU-based frequency calculation Bowen Yu
2025-11-06 4:12 ` Jie Zhan
2025-11-10 17:04 ` Beata Michalska
2025-11-04 7:55 ` [PATCH 2/3] arm64: topology: Use current freq in governor for idle cpus in cpuinfo_avg_freq Bowen Yu
2025-11-10 17:11 ` Beata Michalska
2025-11-16 7:46 ` yubowen (H)
2025-11-04 7:55 ` [PATCH 3/3] arm64: topology: Remove redundant housekeeping_cpu() checks in arch_freq_get_on_cpu Bowen Yu
2025-11-10 17:15 ` Beata Michalska [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=aRIdtuWAIen__yZU@arm.com \
--to=beata.michalska@arm.com \
--cc=catalin.marinas@arm.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=prime.zeng@hisilicon.com \
--cc=ptsm@linux.microsoft.com \
--cc=wanghuiqiang@huawei.com \
--cc=will@kernel.org \
--cc=xuwei5@huawei.com \
--cc=yubowen8@huawei.com \
--cc=zhangpengjie2@huawei.com \
--cc=zhanjie9@hisilicon.com \
--cc=zhenglifeng1@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).