Re: [patch] scheduler bits from 2.5.23-dj1

Andrea Arcangeli
2002-06-20T00:07:01Z

On Wed, Jun 19, 2002 at 04:47:00PM -0700, Robert Love wrote:
> On Wed, 2002-06-19 at 16:35, Ingo Molnar wrote:
>
> > the scheduler optimisation in 2.5.23-dj1, from James Bottomley, look fine
> > to me. I did some modifications:
>
> Nice.
>
> > +static inline unsigned int task_cpu(struct task_struct *p)
> > +static inline unsigned int set_task_cpu(struct task_struct *p, unsigned int cpu)
>
> Technically, shouldn't we make these `unsigned long' ?

obviously not. Supporting 4G cpus is enough for this century, so the
other 32bit would be just wasted space. the 1 in the shiftleft needs the
UL anyways to be correct with >32 cpus (it's not strictly a bug right
now to forget the UL but if we get it right we'll be able to go 64-way
on 64bit systems with no change other than NR_TASKS). So the bitmasks
must be all unsigned longs, the cpu numbers are definitely fine as
unsigned ints.

Even after we break at some point the 64CPU limit growing the bitmask
ala sigset_t, still the cpu numbers will remain unsigned int for a very
long time (probably we'll never have a chance to see the need of
unsigned long cpu numbers in our lifes).

Andrea