lkml.org 
[lkml]   [2006]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sched: 64-bit nr_running

* Daniel Walker <dwalker@mvista.com> wrote:

> > > There was a conversation over the mtd redboot bug related to unsigned
> > > long vs. unsigned int . On a 64-bit machine unsigned long is 64-bits ,
> > > and unsigned int is 32-bits . However, both are 32-bits on a 32-bit
> > > machine .
> > >
> > > Looking over the scheduler I found a few places that use "unsigned
> > > long" for task counting variables (nr_running, nr_active,
> > > nr_interruptible) . The problem is that these variables are all bound
> > > to 29 bits (according to kernel/pid.c) , but they get expanded to
> > > 64-bits on 64-bit machines .
> >
> > your point being?
>
> We could make them unsigned int, and save the extra bits .. Or that's
> what I was thinking about ..

well for performance it's usually best to just have the native machine
word size (i.e. long), unless there's some compelling data-structure
size argument. In any case it's not uncommon to use 'long' for such
types, even though some other aspect of the kernel limits it to less
than 64 (or even 32) bits.

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

\
 
 \ /
  Last update: 2006-05-15 18:37    [W:0.050 / U:2.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site