Re: Calling current() from interrupt context

From: Ralf Baechle (
Date: Mon Oct 09 2000 - 06:25:36 EST

On Sun, Oct 08, 2000 at 05:05:45PM -0600, wrote:

> > > BTW: there is an implicit reference to "current" in smp_processor_id.
> >
> > 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.

For MIPS we use $28 aka $gp which MIPS in it's generosity just doesn't use
for non-GP optimized code to point to current. That actually shaves of a
few kb of the kernel size. From there on it's just one single machine
instruction to get the cpuid which we could probably also hide in some of
the rarely accessed MMU registers.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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