lkml.org 
[lkml]   [2000]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Calling current() from interrupt context
On Sun, Oct 08, 2000 at 03:58:55PM -0700, Mitchell Blank Jr wrote:
> yodaiken@fsmlabs.com wrote:
> > Looking at the code, I don't see any places where "current" is not valid.
> > Got some examples?
>
> It's not that its invalid, it just doesn't make much sense. It points to
> whatever task happened to be running when the interrupt happened. So
> any attempt to access it is 99% likely to be a bug.

Bueno.

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

>
> -Mitch

--
---------------------------------------------------------
Victor Yodaiken
Finite State Machine Labs: The RTLinux Company.
www.fsmlabs.com www.rtlinux.com

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

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.141 / U:9.932 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site