[PATCH 3/3] arm64: topology: Remove redundant housekeeping_cpu() checks in arch_freq_get_on_cpu

Beata Michalska beata.michalska at arm.com
Mon Nov 10 09:15:34 PST 2025


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 at 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
> 



More information about the linux-arm-kernel mailing list