sched: replace cpumask_weight with cpumask_empty where appropriate
authorYury Norov <yury.norov@gmail.com>
Thu, 10 Feb 2022 22:49:06 +0000 (14:49 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 16 Feb 2022 14:57:53 +0000 (15:57 +0100)
commit1087ad4e3f88c474b8134a482720782922bf3fdf
tree93a95570454dd39c349d0e99bf1aab4408e6e218
parent3624ba7b5e2acc02b01301ea5fd3534971eb9896
sched: replace cpumask_weight with cpumask_empty where appropriate

In some places, kernel/sched 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@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220210224933.379149-23-yury.norov@gmail.com
kernel/sched/core.c
kernel/sched/topology.c