Re: pthread_create() slow for many threads; also time to revisit64b context switch optimization?

From: Ingo Molnar
Date: Fri Aug 15 2008 - 13:19:58 EST



* Ulrich Drepper <drepper@xxxxxxxxx> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jamie Lokier wrote:
> > Suggest:
> >
> > +#define MAP_STACK 0x20000 /* 31bit or 64bit address for stack, */
> > + /* whichever is faster on this CPU */
>
> I agree. Except for the comment.
>
>
> > Also, is this _only_ useful for thread stacks, or are there other
> > memory allocations where 31-bitness affects execution speed on old P4s?
>
> Actually, I would define the flag as "do whatever is best assuming the
> allocation is used for stacks".
>
> For instance, minimally the /proc/*/maps output could show "[user
> stack]" or something like this. For security, perhaps, setting of
> PROC_EXEC can be prevented.

makes sense. Updated patch below. I've also added your Acked-by. Queued
it up in tip/x86/urgent, for v2.6.27 merging.

( also, just to make sure: all Linux kernel versions will ignore such
extra flags, so you can just update glibc to use this flag
unconditionally, correct? )

Ingo

--------------------------->