Re: [PATCH] flexmmap: optimise mmap_base gap for hard limited stack

From: Arjan van de Ven
Date: Thu Sep 16 2004 - 12:54:21 EST


On Thu, Sep 16, 2004 at 06:56:13PM +0200, Utz Lehmann wrote:
> Hi
>
> With the flexmmap memory layout there is at least a 128 MB gap between
> mmap_base and TASK_SIZE. I think this is for the case that a running process
> can expand it's stack soft rlimit.
>
> If there is a hard limit for the stack this minium gap is just a waste of
> space. This patch reduce the gap to the hard limit + 1 MB hole. If a process
> has a 8192 KB hard limit it have additional 119 MB space available over the
> current behavior.


I'm not so convinced this is the right approach... a bit of room for the
apps to increase their stack sounds useful. (and a "reasonable" amount is
SuS specified afaik, 128Mb is quite reasonable)


> And the current implemention has a problem. If the stack soft limit is
> 128+ MB there is no hole between the stack and mmap_base. If there is a
> mapping at mmap_base stack overflows are not detected. The patch made a
> 1MB hole between them.

ack on this part.

Attachment: pgp00000.pgp
Description: PGP signature