Re: [RFC/PATCH] RLIMIT_ARG_MAX

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Peter Zijlstra <a.p.zijlstra@...>, aaw <aaw@...>, Andrew Morton <akpm@...>, <michael.kerrisk@...>, <carlos@...>, Alan Cox <alan@...>, linux-kernel <linux-kernel@...>, <drepper@...>, <mtk.manpages@...>
Date: Friday, February 29, 2008 - 12:58 pm

[Adding Ulrich D to the CC]

On Fri, Feb 29, 2008 at 5:05 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:

The advantages are the following:

1. We don't break the ABI.  in 2.6.23, RLIMIT_STACK acquired an
additional semantic: RLIMIT_STACK/4 specified the size for
argv+environ.  aaw@google.com added this feature to allow processes to
have much larger argument lists.  However, if the user sets
RLIMIT_STACK to less than 512k, then the amount of space for
argv+environ falls below the space guaranteed by kernel 2.6.22 and
earlier.    (Older kernels guaranteed at least 128k for argv+environ.)
 Manipulating RLIMIT_STACK did not previously have this effect.  (One
place this matters is with NPTL, where, if RLIMIT_STACK is set to
anything other than unlimited, then it is used as the default stack
size when creating new threads.  When creating many threads, it may
well be desirable to set RLIMIT_STACK to a value lower than 512k.)

While the new functionality provided by aaw@google.com's work is
useful, RLIMIT_STACK really should not have been overloaded with a
second meaning, since it is no longer possible to control stack size
without also changing the limit on argv+environ space.    Hence the
proposal of a new resource limit.

2. It provides a sane mechanism for an application to determine the
space available for argv+environ.  Formerly this space was an
invariant, advertised via sysconf(_SC_ARG_MAX).

3. The implementation details about stack size and size/location of
argv+environ can be decoupled.

Cheers,

Michael
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC/PATCH] RLIMIT_ARG_MAX, Peter Zijlstra, (Wed Feb 27, 9:37 am)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 12:05 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Michael Kerrisk, (Fri Feb 29, 12:58 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Peter Zijlstra, (Fri Feb 29, 1:14 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 1:35 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Peter Zijlstra, (Fri Feb 29, 1:55 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Alan Cox, (Fri Feb 29, 2:40 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Michael Kerrisk, (Fri Feb 29, 2:18 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Geoff Clare, (Sat Mar 1, 4:42 am)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 2:39 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Michael Kerrisk, (Fri Feb 29, 3:49 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 4:07 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 5:57 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Carlos O'Donell, (Sat Mar 1, 10:21 am)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Michael Kerrisk, (Fri Feb 29, 4:43 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 5:34 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 2:14 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 1:12 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Peter Zijlstra, (Fri Feb 29, 1:18 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 1:29 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Pavel Machek, (Tue Mar 4, 4:07 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Peter Zijlstra, (Fri Feb 29, 1:42 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 2:12 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Ollie Wild, (Fri Feb 29, 3:01 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Jakub Jelinek, (Fri Feb 29, 3:09 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Linus Torvalds, (Fri Feb 29, 3:50 pm)
Re: [RFC/PATCH] RLIMIT_ARG_MAX, Ollie Wild, (Fri Feb 29, 4:03 pm)