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

From: linux-os (Dick Johnson)
Date: Tue Dec 20 2005 - 13:36:40 EST



On Tue, 20 Dec 2005, Chase Venters wrote:

> On Tue, 20 Dec 2005, linux-os \(Dick Johnson\) wrote:
>> 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, the pages would not
>> have to be contiguous so dynamic stack allocation
>> would practically never fail. But Linux doesn't
>> use paged virtual memory for stacks. So, there
>> needs to be some rule to control the amount
>> of kernel stack allocated to each task when it
>> executes a system call.
>
> Pardon, but why should "Other operating systems use paged virtual memory
> for stacks" have anything to do with the design of Linux? Other operating
> systems also look for a file called AUTORUN.INF whenever you insert a CD,
> and they'll happily run arbitrary code...

Sorry, you must be talking about M$ stuff. I wasn't. There are
real operating systems that work. They solved a lot of problems
by doing things correctly, learning from the mistakes of others.



which is great when you're a
> motherboard manufacturer providing crappy drivers on a crappy CD with
> crappy artwork and you want to play a jingle before slapping a hideous GUI
> up in front of your unsuspecting user; or perhaps you're Sony and you want
> to hook people's kernel such that you become a sort of media hypervisor.
> And this is the most deployed OS in the game...
>

Also, the M$ __kernel__ doesn't look for any files of any kind except
for its page file which is locates without the file-system, BTW.
If you have the misfortune of using some contraption that uses M$,
just bring up the "Task Manager". Look at the "processes". One
of them there, looks for new disks/mounts/etc at 1-second intervals.
Can you guess which one? Hint. You can't figure it out from its name!

> Linux is a kernel - not a perl script. Programmer laziness is about the
> only excuse I've been able to spot in this discussion that has been raised
> in support of big stacks. (Perhaps all the arguments against aren't worded
> as such; but as far as I've seen they all reduce to it).
>

A kernel stack is simply an implimentation detail. Somebody made
an early decision to use non-paged memory for stacks. From that
point one, we have to either live with it or change it. The
change doesn't involve size. It involves kind.

> If Linux used 4k stacks, we wouldn't have to worry about virtual
> memory *or* contiguous allocations.
>
> - Chase
>

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

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@xxxxxxxxxxxx - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
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/