Re: Calling current() from interrupt context

From: Mitchell Blank Jr (mitch@sfgoth.com)
Date: Sun Oct 08 2000 - 18:19:01 EST


yodaiken@fsmlabs.com wrote:
> > Yes, on architectures that use current->processor that is an exception
> > to the rule. After all, you know for sure that you're still on the
> > same CPU as the task currently running.
>
> This makes sense. And I wish cpu architects would put a cpu-id
> register somewhere
> so that we could have fast computation of cpu-id on smp machines.

Some do (look at asm-sparc/smp.h). However, linux does everything possible
to make dereferencing "current" as fast as possible, so actually just
looping it up there is pretty damn efficient. We need to keep track of the
last cpu a processor ran on anyway to do cpu-affinity heuristics in the
scheduler. So this implementation is quite optimal, actually.

-Mitch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:11 EST