This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Set default stack size from program environment

On Wednesday, March 06, 2013 09:02:56 Siddhesh Poyarekar wrote:
> On Tue, Mar 05, 2013 at 03:17:36PM +0100, Andreas Jaeger wrote:
> > >How about something like this:
> > >
> > >1. A /etc/pthreads.conf with hard limits for stack sizes.  Its
> > >absence means that RLIMIT_STACK is in play
> > >2. A per-user .pthreads.conf with user-level overrides for stack
> > >sizes (default_stack_size=1024K) and/or program-level overrides
> > >(default_stack_size=/usr/bin/foo:2M)
> > >3. An environment variable for process-level overrides.
> > 
> > This would need also a clear semantic: What if both 2 and 3 are
> > used?
> 3 should override 2.  (2) is a configuration for all (or specific)
> programs spawned by the user, while (3) overrides that configuration
> for a specific instantiation of a process.
> > Regarding 1: Doesn't ulimit allow hard limits for stack sizes
> > already?
> That's an upper limit for growth of the main process stack.  This
> would be the initial (and final, since they can't grow) size for
> thread stacks.
> > This kind of different values will be very hard to debug - unless
> > you
> > add also some kind of LD_DEBUG=pthread debugging facility that
> > displays the values read and the choice made.
> Sure, I can do that.  I'll write up a wiki document to describe this,
> so that I don't miss out on any agreed upon details during
> implementation.

Is this feature really worth all this overhead and discussion? It looks 
far too complicated if we need to go to such length. Couldn't we design 
something simpler?

 Andreas Jaeger aj@{,} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]