Re: get_current is __pure__, maybe __const__ even

From: Nick Piggin
Date: Wed Sep 15 2004 - 21:50:06 EST


William Lee Irwin III wrote:

On Wed, Sep 15, 2004 at 10:10:20PM -0400, Albert Cahalan wrote:

I don't think even barrier() is needed.
Suppose gcc were to cache the value of
current over a schedule. Who cares? It'll
be the same after schedule() as it was
before.


Not over a call to schedule(). In the midst of schedule().


In a way, it is. Because after context_switch, the stack
and registers have been replaced by the new task. So if
current was cached somewhere before that task had scheduled
off, then it still would be correct now that it is scheduled
back on.

At points *within* context_switch, current won't be right,
but AFAIKS current is never used in there.
-
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/