Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

padata: replace cpumask_weight with cpumask_empty in padata.c

padata_do_parallel() 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: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Yury Norov and committed by
Herbert Xu
1c4cafd1 28e9b6d8

+1 -1
+1 -1
kernel/padata.c
··· 181 181 goto out; 182 182 183 183 if (!cpumask_test_cpu(*cb_cpu, pd->cpumask.cbcpu)) { 184 - if (!cpumask_weight(pd->cpumask.cbcpu)) 184 + if (cpumask_empty(pd->cpumask.cbcpu)) 185 185 goto out; 186 186 187 187 /* Select an alternate fallback CPU and notify the caller. */