lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 May 2022 08:46:42 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     Yury Norov <yury.norov@...il.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        David Laight <David.Laight@...LAB.COM>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Joe Perches <joe@...ches.com>,
        Julia Lawall <Julia.Lawall@...ia.fr>,
        Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        Nicholas Piggin <npiggin@...il.com>,
        Nicolas Palix <nicolas.palix@...g.fr>,
        Peter Zijlstra <peterz@...radead.org>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
        linux-kernel@...r.kernel.org,
        "Rafael J . Wysocki" <rafael@...nel.org>, linux-pm@...r.kernel.org
Subject: Re: [PATCH 21/22] cpufreq: use cpumask_weight_gt() in
 policy_is_shared()

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@...nel.org>
> CC: Viresh Kumar <viresh.kumar@...aro.org>
> CC: linux-pm@...r.kernel.org
> CC: linux-kernel@...r.kernel.org
> Signed-off-by: Yury Norov <yury.norov@...il.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@...aro.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ