lkml.org 
[lkml]   [2005]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/6] x86_64: enable xchg optimization for x86_64
Date
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

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 <ak@suse.de> to x86-64.
I.e. the implementation was written, is present in the tree, but due to this:

#ifdef CONFIG_RWSEM_GENERIC_SPINLOCK
#include <linux/rwsem-spinlock.h> /* use a generic implementation */
#else
#include <asm/rwsem.h> /* 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 <ak@suse.de>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
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/

\
 
 \ /
  Last update: 2005-10-26 00:15    [from the cache]
©2003-2011 Jasper Spaans