Skip to content
Commit 6cc18331 authored by Yury Norov's avatar Yury Norov
Browse files

lib/find_bit: add find_next{,_and}_bit_wrap



The helper is better optimized for the worst case: in case of empty
cpumask, current code traverses 2 * size:

  next = cpumask_next_and(prev, src1p, src2p);
  if (next >= nr_cpu_ids)
  	next = cpumask_first_and(src1p, src2p);

At bitmap level we can stop earlier after checking 'size + offset' bits.

Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
parent 33e67710
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment