Re: About 4k kernel stack size....

From: Jan Engelhardt
Date: Wed Dec 21 2005 - 17:49:29 EST


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

Without me knowing every single detail of this matter, just try to hold a
mutex over function calls in the BSD kernel. While you can acquire a mutex
(=spinlock) (local to the module implementing the chardev) in e.g. the
open() routine of a chardev in Linux, and release it upon close(), you'll
get a segfault on BSD. Ok, Linux got nothing to do with BSD, but that's
what I remember from porting some code, and it resembles what is discussed
above.
(http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2004-12/0337.html)



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