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

Paul Jackson
2004-04-01T15:25:10Z

> > #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@sgi.com> 1.650.933.1373