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

From: Utz Lehmann
Date: Thu Sep 16 2004 - 13:32:08 EST


Arjan van de Ven [arjanv@xxxxxxxxxx] wrote:
> 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)

This is only for a hard limited (rlim_max) stack. A non-root application
can not increase it anyway.
The default (rlim_cur = ~8MB, rlim_max = ulimited) is unchanged and get a
gap of 128MB.

A check for CAP_SYS_RESOURCE can be added. But i dont think it's worth.
-
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/