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.

cpumask: use cpumask_next_wrap() where appropriate

Now that cpumask_next{_and}_wrap() is wired to generic
find_next_bit_wrap(), we can use it in cpumask_any{_and}_distribute().

This automatically makes the cpumask_*_distribute() functions to use
small_cpumask_bits instead of nr_cpumask_bits, which itself is a good
optimization.

Signed-off-by: Yury Norov <yury.norov@gmail.com>

+2 -3
+2 -3
lib/cpumask.c
··· 171 171 /* NOTE: our first selection will skip 0. */ 172 172 prev = __this_cpu_read(distribute_cpu_mask_prev); 173 173 174 - next = find_next_and_bit_wrap(cpumask_bits(src1p), cpumask_bits(src2p), 175 - nr_cpumask_bits, prev + 1); 174 + next = cpumask_next_and_wrap(prev, src1p, src2p); 176 175 if (next < nr_cpu_ids) 177 176 __this_cpu_write(distribute_cpu_mask_prev, next); 178 177 ··· 191 192 192 193 /* NOTE: our first selection will skip 0. */ 193 194 prev = __this_cpu_read(distribute_cpu_mask_prev); 194 - next = find_next_bit_wrap(cpumask_bits(srcp), nr_cpumask_bits, prev + 1); 195 + next = cpumask_next_wrap(prev, srcp); 195 196 if (next < nr_cpu_ids) 196 197 __this_cpu_write(distribute_cpu_mask_prev, next); 197 198