This is the mail archive of the libc-alpha@sources.redhat.com 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] allow LinuxThreads to have larger stacks for the mainthread


> > +/* The max size of the main thread's stack.  Only used if
> > +   !FLOATING_STACKS and !_STACK_GROWS_UP.  */
> > +#ifndef MAIN_STACK_SIZE_MAX
> > +#define MAIN_STACK_SIZE_MAX  (64 * STACK_SIZE)
> > +#endif
> 
> This is not usable.  Many architectures severely limit the stack size.
> On x86 there is a hard limit of 8MB.  The remaining 120MB would be
> unused, or worse, used for other mappings.

I believe you misread the patch, perhaps MAIN_STACK_SIZE_MAX is a bad
name.  In general, with the patch _the user's stack rlimit_ is used to
set __pthread_initial_thread_bos.  Only if the stack rlimit would be
larger than MAIN_STACK_SIZE_MAX (such as RLIMIT_INFINITY or what it is
called), the size would be clipped, such that there is still some room
for thread stacks.

So, for the default stack limit of 8MB, only 8MB (and not 128MB) would
be reserved for the main stack instead of the current 4MB.

Regards,
Wolfram.


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