• Yury Norov's avatar
    lib/find_bit: add find_next{,_and}_bit_wrap · 6cc18331
    Yury Norov authored
    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>
    6cc18331
cpumask.c 4.97 KB