Re: [PATCH 47/54] sched: replace cpumask_weight with cpumask_weight_eq where appropriate

From: Peter Zijlstra
Date: Mon Jan 24 2022 - 03:06:18 EST


On Sun, Jan 23, 2022 at 10:39:18AM -0800, Yury Norov wrote:
> kernel/sched code uses cpumask_weight() to compare the weight of
> cpumask with a given number. We can do it more efficiently with
> cpumask_weight_eq because conditional cpumask_weight may stop
> traversing the cpumask earlier, as soon as condition is met.
>

Same as with the other patch, you're just making the code more difficult
to read for no reason.