Re: [Patch 17/23] mask v2 = [6/7] nodemask_t_ia64_changes

From: Paul Jackson
Date: Wed Apr 07 2004 - 06:33:26 EST


A few hours ago, I sketched the following code:

> for (
> ({ i = 0; while(!node_set(i, mask) && i < MAX_NUMNODES) i++; i; });
> i < MAX_NUMNODES;
> ({ i++; while(!node_set(i, mask) && i < MAX_NUMNODES) i++; i; })
> )


I've reduced this to a pair of bitmap.h operators:

> #define find_next_bit_in_bitmap(src, nbits, n) \
> ({ int i = (n); while(i < (nbits) && !test_bit(i, (src))) i++; i; })
>
> #define find_first_bit_in_bitmap(src, nbits) \
> find_next_bit_in_bitmap((src), (nbits), 0)

which are plug compatible with bitops find_first_bit() and find_next_bit(),
but smaller. These alternatives can then be used in the for-loop defines.

The above is not yet compiled or tested ... Use at own risk.

My next mask patchset will have these. Following the excellent
recommendations of Rusty however, my next mask patchset won't have
masks ;). Just cpumasks bolted directly on top of souped up bitmaps.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/