* [PATCH 21/22] cpufreq: use cpumask_weight_gt() in policy_is_shared()
[not found] <20220510154750.212913-1-yury.norov@gmail.com>
@ 2022-05-10 15:47 ` Yury Norov
2022-05-11 3:16 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Yury Norov @ 2022-05-10 15:47 UTC (permalink / raw)
To: Andy Shevchenko, David Laight, Greg Kroah-Hartman, Joe Perches,
Julia Lawall, Michał Mirosław, Nicholas Piggin,
Nicolas Palix, Peter Zijlstra, Rasmus Villemoes, Matti Vaittinen,
linux-kernel
Cc: Yury Norov, Rafael J . Wysocki, Viresh Kumar, linux-pm
cpumask_weight_gt() is better than cpumask_weight() because it may
return earlier depending on condition.
CC: Rafael J. Wysocki <rafael@kernel.org>
CC: Viresh Kumar <viresh.kumar@linaro.org>
CC: linux-pm@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
include/linux/cpufreq.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index d5595d57f4e5..865cc9e23518 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -214,7 +214,7 @@ static inline bool policy_is_inactive(struct cpufreq_policy *policy)
static inline bool policy_is_shared(struct cpufreq_policy *policy)
{
- return cpumask_weight(policy->cpus) > 1;
+ return cpumask_weight_gt(policy->cpus, 1);
}
#ifdef CONFIG_CPU_FREQ
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 21/22] cpufreq: use cpumask_weight_gt() in policy_is_shared()
2022-05-10 15:47 ` [PATCH 21/22] cpufreq: use cpumask_weight_gt() in policy_is_shared() Yury Norov
@ 2022-05-11 3:16 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2022-05-11 3:16 UTC (permalink / raw)
To: Yury Norov
Cc: Andy Shevchenko, David Laight, Greg Kroah-Hartman, Joe Perches,
Julia Lawall, Michał Mirosław, Nicholas Piggin,
Nicolas Palix, Peter Zijlstra, Rasmus Villemoes, Matti Vaittinen,
linux-kernel, Rafael J . Wysocki, linux-pm
On 10-05-22, 08:47, Yury Norov wrote:
> cpumask_weight_gt() is better than cpumask_weight() because it may
> return earlier depending on condition.
>
> CC: Rafael J. Wysocki <rafael@kernel.org>
> CC: Viresh Kumar <viresh.kumar@linaro.org>
> CC: linux-pm@vger.kernel.org
> CC: linux-kernel@vger.kernel.org
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> ---
> include/linux/cpufreq.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index d5595d57f4e5..865cc9e23518 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -214,7 +214,7 @@ static inline bool policy_is_inactive(struct cpufreq_policy *policy)
>
> static inline bool policy_is_shared(struct cpufreq_policy *policy)
> {
> - return cpumask_weight(policy->cpus) > 1;
> + return cpumask_weight_gt(policy->cpus, 1);
> }
>
> #ifdef CONFIG_CPU_FREQ
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Though the patch to add cpumask_weight_gt() is still in linux-next and so this
patch should get merged after rc1 is out.
And it would have been nice to know of this dependency in the original mail
itself instead of me searching for it :)
--
viresh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-11 3:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220510154750.212913-1-yury.norov@gmail.com>
2022-05-10 15:47 ` [PATCH 21/22] cpufreq: use cpumask_weight_gt() in policy_is_shared() Yury Norov
2022-05-11 3:16 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox