Re: [Patch 6/23] mask v2 - Replace cpumask_t with one using mask

From: Matthew Dobson
Date: Fri Apr 02 2004 - 20:12:03 EST


On Fri, 2004-04-02 at 15:35, Paul Jackson wrote:
> > What do you think about this?
>
> Check out my patch 24 of 23, sent last night, which should make
> cpumask_of_cpu() efficient for UP systems.

Yep, I was just reading through that patch. It's an interesting
solution, but I'm not quite sure how I feel about it. It's definitely
not the way I would have solved the problem, but it looks like it will
work fine. My only problem with it is that it seems to preclude the
possibility of having two different sized masks in a single file. At
least without making a .h file for each different mask, and then
including each those files in the .c file that needs the multiple
masks. This behavior is fine for cpumasks & nodemasks, but makes it
difficult for arbitrary masks. I don't foresee this happening a lot
(multiple different size masks excluding cpumasks and nodemasks), so it
shouldn't be a big deal.

My first impression would be to just define both MASK_ALL1 & MASK_ALL2,
and less importantly mask_of_bit1 & mask_of_bit2, in mask.h, and let
whatever is using the macros choose the appropriate one to use. For
example, moving the cpumask_of_bit() & CPU_MASK_ALL defines into the
#ifdef CONFIG_SMP part. This alleviates the (albeit unlikely) problem
of multiple masks.

-Matt

-
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/