[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aRIdtuWAIen__yZU@arm.com>
Date: Mon, 10 Nov 2025 18:15:34 +0100
From: Beata Michalska <beata.michalska@....com>
To: Bowen Yu <yubowen8@...wei.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
catalin.marinas@....com, will@...nel.org, ptsm@...ux.microsoft.com,
linuxarm@...wei.com, jonathan.cameron@...wei.com,
zhanjie9@...ilicon.com, prime.zeng@...ilicon.com,
wanghuiqiang@...wei.com, xuwei5@...wei.com, zhenglifeng1@...wei.com,
zhangpengjie2@...wei.com
Subject: Re: [PATCH 3/3] arm64: topology: Remove redundant housekeeping_cpu()
checks in arch_freq_get_on_cpu
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@...wei.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
>
Powered by blists - more mailing lists