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

From: Ingo Molnar
Date: Fri Aug 15 2008 - 12:04:38 EST



* Jamie Lokier <jamie@xxxxxxxxxxxxx> wrote:

> > how about this then?
>
> > +#define MAP_64BIT_STACK 0x20000 /* give out 32bit addresses on old CPUs */
>
> I think the flag makes sense but it's name is confusing - 64BIT for a
> flag which means "maybe request 32-bit stack"! Suggest:
>
> +#define MAP_STACK 0x20000 /* 31bit or 64bit address for stack, */
> + /* whichever is faster on this CPU */

ok. I've applied the patch below to tip/x86/urgent.

> Also, is this _only_ useful for thread stacks, or are there other
> memory allocations where 31-bitness affects execution speed on old
> P4s?

just about anything i guess - but since those CPUs do not really matter
anymore in terms of bleeding-edge performance, what we care about is the
intended current use of this flag: thread stacks.

Ingo

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