lkml.org 
[lkml]   [2000]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Calling current() from interrupt context
Date
From
> Linus Torvalds wrote:
> > You can also still do the stack pointer plaything by just using
> > indirection: and when you context switch you switch the pointer around =
> at
> > the base of the per-cpu interrupt stack.
>
> Indirection, =E0 la "current =3D *(stack & ~8191)" might not be a bad ide=
> a
> in general. As Ralf Baechle noted, having all the task structs at the
> same offset isn't good for the cache.

Having the stacks aligned also isnt good for the caches. If you are bored some
time instrument the cache lines that wake_up() touches on a wake. Its very
common to see most of them being on the same line because each kernel thread
waiting on the same event (eg poll in apache) is at the same kernel and user
stack depth.

Userspace is not entirely guilt free either but in userspace teaching crt0.S
to randomise the stack base a little can be done, and the environ/argv tends
to perturb stuff that isnt fork()'ed


-
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.110 / U:0.404 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site