Re: [PATCH] mask ADT: replace cpumask_t implementation [3/22]

From: Paul Jackson
Date: Thu Apr 01 2004 - 10:27:36 EST


> > #define cpu_online_map cpumask_of_cpu(0)
> > #define cpu_possible_map cpumask_of_cpu(0)
> > ...
> Might it make more sense to actually define a cpu_online_map &
> cpu_possible_map for UP, rather than generating this code:
>
> #define mask_of_bit(bit, T) \
> ({ \
> typeof(T) m; \
> mask_clearall(m); \
> mask_setbit((bit), m); \
> m; \
> })
>
> every time some code references cpu_online_map? It'll only cost us 2
> unsigned longs on 32-bit == 8 bytes...

Perhaps.

When I looked at the code just now, this only seemed to take a
couple of instructions. Do you think that there is much to gain?
Better a couple of inline instructions than a possible uncached
memory reference, I suspect.

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