mirror of
https://github.com/torvalds/linux.git
synced 2026-01-12 00:42:35 +08:00
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>
This commit is contained in:
@@ -171,8 +171,7 @@ unsigned int cpumask_any_and_distribute(const struct cpumask *src1p,
|
||||
/* NOTE: our first selection will skip 0. */
|
||||
prev = __this_cpu_read(distribute_cpu_mask_prev);
|
||||
|
||||
next = find_next_and_bit_wrap(cpumask_bits(src1p), cpumask_bits(src2p),
|
||||
nr_cpumask_bits, prev + 1);
|
||||
next = cpumask_next_and_wrap(prev, src1p, src2p);
|
||||
if (next < nr_cpu_ids)
|
||||
__this_cpu_write(distribute_cpu_mask_prev, next);
|
||||
|
||||
@@ -192,7 +191,7 @@ unsigned int cpumask_any_distribute(const struct cpumask *srcp)
|
||||
|
||||
/* NOTE: our first selection will skip 0. */
|
||||
prev = __this_cpu_read(distribute_cpu_mask_prev);
|
||||
next = find_next_bit_wrap(cpumask_bits(srcp), nr_cpumask_bits, prev + 1);
|
||||
next = cpumask_next_wrap(prev, srcp);
|
||||
if (next < nr_cpu_ids)
|
||||
__this_cpu_write(distribute_cpu_mask_prev, next);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user