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

Andrew Morton
2006-06-26T16:57:50Z

On Fri, 23 Jun 2006 12:54:49 +0200
Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> Some folks find 128KB of env+arg space too little. Solaris provides them with
> 1MB. Manually changing MAX_ARG_PAGES worked for them so far, however they
> would like to run the supported vendor kernel.
>
> In the interest of not penalising everybody with the overhead of just
> setting it larger, provide a sysctl to change it.
>
> Compiles and boots on i386.

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 ;)

Also, I'm not sure that we need max_arg_pages_min and max_arg_pages_max -
it's a privileged operation and we can just let root decide whether or not
to screw up the machine.