Re: sched: 64-bit nr_running

From: Daniel Walker
Date: Mon May 15 2006 - 13:46:54 EST


On Mon, 2006-05-15 at 18:34 +0200, Ingo Molnar wrote:

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

I also noticed that struct task_struct -> state uses a volatile long ,
but it seems to only use a few bits . exit_state also uses a long type
and only uses a few bits .. They could be combined into one long (or
even and int) .. I noticed the comment below,

* We have two separate sets of flags: task->state
* is about runnability, while task->exit_state are
* about the task exiting. Confusing, but this way
* modifying one set can't modify the other one by
* mistake.

I think if it was all inside macro's it wouldn't be so easy to
accidentally set the exit_state when touching just state ..

Daniel

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