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 Mon, Oct 09, 2000 at 02:21:09AM +0100, Kenn Humborg wrote:
> On Mon, Oct 09, 2000 at 02:20:27AM +0200, Andi Kleen wrote:
> > 2.4 TCP code relies on current being valid in a softirq.
>
> Well, then as long as Linux guarantees that there is always a
> valid 'current task' on a CPU, then I can special-case the
> called-from-interrupt case. The previous kernel stack pointer
> is accessible from another processor register, so I can go in
> there and pull it out and use it to calculate current.
>
> Is it possible to get an interrupt during context switching,
> for example? Or any other window during which there isn't
> a valid current?

You can get interrupts while running in user space and there
isn't a valid current register. So you have to initialise it always
in the interrupt entry. As long as you don't have to support SMP
it is easy (just store current in a global variable and load it from there),
with SMP it is more tricky but still possible, e.g. when you have
some hidden register.

>
> And what the hell does TCP need current for anyway?

For a very hackish user context TCP implementation that probably should
be cleaned up (but it is code freeze etc.etc.blabla.)

-Andi
-
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.328 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site