[PATCH 6/6] x86_64: enable xchg optimization for x86_64

From: Paolo 'Blaisorblade' Giarrusso
Date: Tue Oct 25 2005 - 17:13:07 EST


From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>

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@xxxxxxxxxx).
* Ported by Andi Kleen <ak@xxxxxxx> 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@xxxxxxx>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
---

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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/