Re: [PATCH rcu 9/9] rcu: Replace cpumask_weight with cpumask_empty where appropriate

From: Frederic Weisbecker
Date: Fri Feb 11 2022 - 10:18:03 EST


On Fri, Feb 04, 2022 at 03:08:05PM -0800, Paul E. McKenney wrote:
> From: Yury Norov <yury.norov@xxxxxxxxx>
>
> In some places, RCU code calls cpumask_weight() to check if any bit of a
> given cpumask is set. We can do it more efficiently with cpumask_empty()
> because cpumask_empty() stops traversing the cpumask as soon as it finds
> first set bit, while cpumask_weight() counts all bits unconditionally.
>
> Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx>
> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>

Acked-by: Frederic Weisbecker <frederic@xxxxxxxxxx>