Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932452AbVJYWMW (ORCPT ); Tue, 25 Oct 2005 18:12:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932440AbVJYWLV (ORCPT ); Tue, 25 Oct 2005 18:11:21 -0400 Received: from [151.97.230.9] ([151.97.230.9]:44728 "EHLO ssc.unict.it") by vger.kernel.org with ESMTP id S932443AbVJYWLS (ORCPT ); Tue, 25 Oct 2005 18:11:18 -0400 From: "Paolo 'Blaisorblade' Giarrusso" Subject: [PATCH 6/6] x86_64: enable xchg optimization for x86_64 Date: Wed, 26 Oct 2005 00:13:52 +0200 To: Andrew Morton Cc: Jeff Dike , linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net Message-Id: <20051025221351.21106.57194.stgit@zion.home.lan> In-Reply-To: <20051025221105.21106.95194.stgit@zion.home.lan> References: <20051025221105.21106.95194.stgit@zion.home.lan> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1542 Lines: 53 From: Paolo 'Blaisorblade' Giarrusso i386 enables the xchg based implementation of r/w semaphores for any processor as good as 486. So it was quite interesting to see x86_64 never using it! And it was even more interesting to see, in rwsem.h: /* rwsem.h: R/W semaphores implemented using XADD/CMPXCHG for x86_64+ * * Written by David Howells (dhowells@redhat.com). * Ported by Andi Kleen to x86-64. I.e. the implementation was written, is present in the tree, but due to this: #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK #include /* use a generic implementation */ #else #include /* use an arch-specific implementation */ #endif it was probably _NEVER_ compiled!!! So, handle with care this one-liner, and test it properly. CC: Andi Kleen Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- arch/x86_64/Kconfig | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig @@ -39,11 +39,10 @@ config SBUS bool config RWSEM_GENERIC_SPINLOCK - bool - default y + def_bool n config RWSEM_XCHGADD_ALGORITHM - bool + def_bool y config GENERIC_CALIBRATE_DELAY bool - 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/