Messages in this thread | | | Date | Fri, 15 Aug 2008 16:54:57 +0100 | From | Jamie Lokier <> | Subject | Re: pthread_create() slow for many threads; also time to revisit 64b context switch optimization? |
| |
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
| |