Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753306AbYHMQDJ (ORCPT ); Wed, 13 Aug 2008 12:03:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751582AbYHMQC4 (ORCPT ); Wed, 13 Aug 2008 12:02:56 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:51808 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbYHMQCz (ORCPT ); Wed, 13 Aug 2008 12:02:55 -0400 Date: Wed, 13 Aug 2008 18:02:18 +0200 From: Ingo Molnar To: Ulrich Drepper Cc: Arjan van de Ven , akpm@linux-foundation.org, hugh@veritas.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, briangrant@google.com, cgd@google.com, mbligh@google.com, Linus Torvalds , Thomas Gleixner , "H. Peter Anvin" Subject: Re: pthread_create() slow for many threads; also time to revisit 64b context switch optimization? Message-ID: <20080813160218.GB18037@elte.hu> References: <20080813104445.GA24632@elte.hu> <20080813063533.444c650d@infradead.org> <48A2EE07.3040003@redhat.com> <20080813142529.GB21129@elte.hu> <48A2F157.7000303@redhat.com> <20080813151007.GA8780@elte.hu> <48A2FC17.9070302@redhat.com> <20080813154043.GA11886@elte.hu> <48A303EE.8070002@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A303EE.8070002@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2556 Lines: 71 * Ulrich Drepper wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Ingo Molnar wrote: > > Btw., can you see any problems with option #1: simply removing MAP_32BIT > > from 64-bit stack allocations in glibc unconditionally? > > Yes, as we both agree, there are still such machines out there. > > The real problem is: what to do if somebody complains? If we would > have the extra flag such people could be accommodated. If there is no > such flag then distributions cannot just add the flag (it's part of > the kernel API) and they would be caught between a rock and a hard > place. Option #2 provides the biggest flexibility. > > I upstream kernel truly doesn't care about such machines anymore there > are two options: > > - - really do nothing at all do nothing at all is not an option - thread creation can take 10 msecs on top-of-the-line hardware. > - - at least reserve a flag in case somebody wants/has to implement option > #2 yeah, i already had a patch for that when i wrote my first mail [attached below] and listed it as option #4 - then erased the comment figuring that we'd want to do #1 ;-) 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? Ingo ---------------------> Subject: mmap: add MAP_64BIT_STACK From: Ingo Molnar Date: Wed Aug 13 12:41:54 CEST 2008 Signed-off-by: Ingo Molnar --- include/asm-x86/mman.h | 1 + 1 file changed, 1 insertion(+) Index: linux/include/asm-x86/mman.h =================================================================== --- linux.orig/include/asm-x86/mman.h +++ linux/include/asm-x86/mman.h @@ -12,6 +12,7 @@ #define MAP_NORESERVE 0x4000 /* don't check for reservations */ #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ #define MAP_NONBLOCK 0x10000 /* do not block on IO */ +#define MAP_64BIT_STACK 0x20000 /* give out 32bit addresses on old CPUs */ #define MCL_CURRENT 1 /* lock all current mappings */ #define MCL_FUTURE 2 /* lock all future mappings */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/