Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812Ab0AEQPe (ORCPT ); Tue, 5 Jan 2010 11:15:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932067Ab0AEQPd (ORCPT ); Tue, 5 Jan 2010 11:15:33 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:38332 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179Ab0AEQPb (ORCPT ); Tue, 5 Jan 2010 11:15:31 -0500 Date: Tue, 5 Jan 2010 08:14:51 -0800 (PST) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: KAMEZAWA Hiroyuki cc: Minchan Kim , Peter Zijlstra , "Paul E. McKenney" , Peter Zijlstra , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , cl@linux-foundation.org, "hugh.dickins" , Nick Piggin , Ingo Molnar Subject: Re: [RFC][PATCH 6/8] mm: handle_speculative_fault() In-Reply-To: Message-ID: References: <20100104182429.833180340@chello.nl> <20100104182813.753545361@chello.nl> <20100105092559.1de8b613.kamezawa.hiroyu@jp.fujitsu.com> <28c262361001042029w4b95f226lf54a3ed6a4291a3b@mail.gmail.com> <20100105134357.4bfb4951.kamezawa.hiroyu@jp.fujitsu.com> <20100105143046.73938ea2.kamezawa.hiroyu@jp.fujitsu.com> <20100105163939.a3f146fb.kamezawa.hiroyu@jp.fujitsu.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 43 On Tue, 5 Jan 2010, Linus Torvalds wrote: > > Lookie here: > > - arch/x86/Kconfig.cpu: > > config X86_XADD > def_bool y > depends on X86_32 && !M386 > > - arch/x86/Kconfig: > > config RWSEM_GENERIC_SPINLOCK > def_bool !X86_XADD > > config RWSEM_XCHGADD_ALGORITHM > def_bool X86_XADD > > it looks like X86_XADD only gets enabled on 32-bit builds. Which means > that x86-64 in turn seems to end up always using the slower "generic > spinlock" version. Sadly, it's not as easy as just changing the X86_XADD "depends on" to say "X86_64 || !M386" instead. That just results in kernel/built-in.o: In function `up_read': (.text+0x2d8e5): undefined reference to `call_rwsem_wake' etc, because the x86-64 code has obviously never seen the optimized call-paths, and they need the asm wrappers for full semantics. Oh well. Somebody who is bored might look at trying to make the wrapper code in arch/x86/lib/semaphore_32.S work on x86-64 too. It should make the successful rwsem cases much faster. Linus -- 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/