lkml.org 
[lkml]   [2004]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Introduce nodemask_t ADT [0/7]
From
Date
On Thu, 2004-03-18 at 18:04, Andi Kleen wrote:
> Matthew Dobson <colpatch@us.ibm.com> writes:
>
> >> Chris Hellwig responded to it at the time asking why I didn't provide a
> >> single generic mask ADT, and make cpumask and nodemask instances of
> >> that.
> >
> > That is a better idea, if it can be made to work. My goal is to stop
>
> It already exists in linux/bitmap.h. I use that in NUMA API for the node masks.
>
> It's just a bit ugly to write because you have to always pass MAX_NUMNODES.
> Some wrappers would be prettier.
>
> -Andi

For MAX_NUMNODES > BITS_PER_LONG, thats just what these are. There are
just built-in optimizations for the single bit (UP for cpumask, non-NUMA
for nodemask) case and the single unsigned long case. For the case of a
single unsigned long, the bitmap operations aren't as efficient as just
doing a
res = (mask1 & mask2);
vs.
bitmask_and(&res, &mask1, &mask2);

Maybe I'm overly concerned about the speed of these ops at the expense
of code size. If that's the consensus, I'll gladly look at a simpler
implementation. As I said, my only real goal is to stop people open
coding these types of operations.

-Matt

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:01    [W:0.238 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site