Re: Does process need to have a kernel-side stack all the time?
From: Arjan van de Ven
Date: Wed Apr 16 2008 - 10:34:37 EST
On Wed, 16 Apr 2008 16:20:43 +0200
Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx> wrote:
>
> And my "random thought" occurred along the lines "Ingo once ran
> 100000 threads and then ran out of space for stack... wait a minute!
> Why every single one of those threads need to have a stack at the
> same time? They sure as hell can't actively use more than NR_CPUS
> stacks at once!".
>
> Pity it wouldn't work.
you could make it work ... sort of.
That is, you can deal with the case with apps that sleep on select/poll/sleep
(which is the majority)
by starting out at a small stack (say 512 bytes), and then in the syscall code switch
to a 4Kb stack for all but these 3 "known to not go deep but normal sleepers" syscalls.
I doubt it's worth the complexity, but it very likely could be made to work.... it's just
going to get very messy (how to deal with "current" is just the start of the messyness)
--
If you want to reach me at my work email, use arjan@xxxxxxxxxxxxxxx
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
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/