Re: [PATCH] binfmt: turn MAX_ARG_PAGES into a sysctl tunable

Linus Torvalds
2006-06-26T17:22:09Z

On Mon, 26 Jun 2006, Andrew Morton wrote:
>
> AFAICS, the main downside of simply increasing MAX_ARG_PAGES is that
> fixed-size array in `struct linux_binprm'. You've solved that via kmalloc,
> so can we avoid the sysctl? We can now increase MAX_ARG_PAGES to something
> ridiculous with basically no cost? It's swappable memory and should be
> limited by the RLIMIT_RSS which we don't implement ;)

It's _not_ swappable memory, sadly. It's swappable before it hits
linux_binprm, and it's swappable after it's mapped into the destination,
but it is _not_ swappable while it's held in the bprm->page[] array ;/

I totally re-organized how execve() allocates the new mm at an execve
several years ago (it used to re-use the old MM if it could), and that was
so that we count just remove the brpm->page array, and just install the
pages directly into the destination.

That was in 2002. I never actually got around to doing it ;(.

Linus