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

From: Jamie Lokier
Date: Fri Aug 15 2008 - 11:55:47 EST


Ingo Molnar wrote:
> As unimplemented flags just get ignored by the kernel, if this flag goes
> into v2.6.27 as-is and is ignored by the kernel (i.e. we just use a
> plain old 64-bit [47-bit] allocation), then you could do the glibc
> change straight away, correct? So then if people complain we can fix it
> in the kernel purely.
>
> 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 */

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

-- Jamie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/