> Would it be usefull to create a kernel flag to mark all process stack > memory with |MAP_NORESERVE|, e.g. don't allocate swap memory for stacks > ? The idea is to reduce the swap requirements for platforms like settop > boxes etc. with limited or no swap space by exploiting the detail that > almost all applications reserve memory for large stacks (8MB default) > but only use a tiny fraction (most shells and shell applications rarely > use more than 64k).
When you say, "limited or no swap space," what are you really talking about here? Solaris can use both memory and disk as reserved memory swap. Check out anon_resvmem() in the kernel. It can take pages from either a swap device or memory. If you have a fininite amount of resource, using MAP_NORESERVE means that your failure mode for overuse will be non-deterministic. I.e. you'll get a SIGBUS or SIGSEGV when you try to write to the stack and a page cannot be allocated. I'm in favor of the more deterministic method of having the failure occur at allocation time because we're out of memory. (It's easier to debug too) -j _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
