On Fri, 16 Dec 2005, Horst von Brand wrote:
linux-os \(Dick Johnson\) <linux-os@xxxxxxxxxxxx> wrote:stack
[...]
Throughout the past two years of 4k stack-wars, I never heard why
such a small stack was needed (not wanted, needed). It seems that
everybody "knows" that smaller is better and most everybody thinks
that one page in ix86 land is "optimum". However I don't think
anybody ever even tried to analyze what was better from a technical
perspective. Instead it's been analyzed as religious dogma, i.e.,
keep the stack small, it will prevent idiots from doing bad things.
OK, so here goes again...
The kernel stack has to be contiguous in /physical/ memory. Keep the/one/ page, that way you can always get a new stack when needed (==eachfork(2) or clone(2)). If the stack is 2 (or more) pages, you'll havetofind (or create) a multi-page free area, and (fragmentation being whatitis, and Linux routinely running for months at a time) you are in awholenew world of pain.
The interrupt stack needs to be non-paged. Are you sure the user-stacks
need to be 'physical', non-paged too? If so, that's probably the
problem. All addresses accessed by the CPUs in the kernel are virtual
which means one needs some mapping anyway.