Re: [patch] scheduler bits from 2.5.23-dj1

From: Andrea Arcangeli (andrea@suse.de)
Date: Wed Jun 19 2002 - 19:07:51 EST


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



This archive was generated by hypermail 2b29 : Sun Jun 23 2002 - 22:00:20 EST