lkml.org 
[lkml]   [2005]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: About 4k kernel stack size....
linux-os (Dick Johnson) writes:
>
> On Wed, 21 Dec 2005, Nikita Danilov wrote:
>
> > linux-os (Dick Johnson) writes:
> > >
> > > On Tue, 20 Dec 2005, Nikita Danilov wrote:
> > >
> > > > linux-os \(Dick Johnson\) writes:
> > > > >
> > > >
> > > > [...]
> > > >
> > > > > See, isn't rule-making fun? This whole 4k stack-
> > > > > thing is really dumb. Other operating systems
> > > > > use paged virtual memory for stacks, except
> > > > > for the interrupt stack. If Linux used paged
> > > > > virtual memory for stacks,
> > > >
> > > > ... then spin-locks couldn't be held across function calls.
> > > >
> > >
> > > Sure they can! In ix86 machines the local 'cli' within the
> >
> > Sure they cannot: one cannot schedule with spin-lock held, and major
> > page fault will block for IO.
> >
> > [...]
> >
>
> Read the text you deleted and you will learn how.

I am afraid, I'd better not:

- spin-locks do not imply disabled interrupts;

- how can "swapper" guarantee that there is enough pages in the free
list to satisfy stack page faults atomically? The only way is to keep
free page for each thread. But then it's so much easier to just use
this reserved page for the stack from the very beginning.

Note, that RSX/RT didn't have "kernel threads" at all: it was
implemented as a non-blocking state machine serving user requests on
per-cpu stacks (at least pdp-15 versions).

>
> Cheers,
> Dick Johnson
> Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips).
> Warning : 98.36% of all statistics are fiction.
> .

Nikita.
-
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-12-21 16:21    [W:0.060 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site