lkml.org 
[lkml]   [2004]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: 4k stacks in 2.6
From
Date
On Thu, 2004-05-27 at 07:55, Linus Torvalds wrote:

> "minor implementation detail"?
>
> You need to get to the thread info _some_ way, and you need to get to it
> _fast_. There are really no sane alternatives. I certainly do not want to
> play games with segments.

While segments on x86 are in general to be avoided (aka the 286
segmented memory models) they can be useful for some things in the
kernel.

Here's a couple of examples:
* dereference gs:0 to get the thread info. The first element in
the structure is its linear address (ie usable for being deref'd
off of DS).
* use SS to enforce the stack limit. This way you'd absolutely
get an exception when there was a stack overflow (underflow).
SS gets reloaded on entry into the kernel and on interrupts
anyway so there really shouldn't be a performance impact. I
haven't looked at all the (potential) gcc implications here so
this one may not be completely doable.
--

TTFN - Guy

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

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.189 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site