[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070822150043.GA8504@Krystal>
Date: Wed, 22 Aug 2007 11:00:43 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To: Christoph Lameter <clameter@....com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
mingo@...hat.com
Subject: [PATCH] define have_arch_cmpxchg()
define have_arch_cmpxchg()
* Christoph Lameter (clameter@....com) wrote:
> If we really want to do this then the implementation of all of these
> components need to result in competitive performance on all platforms.
>
Here is the first of 2 proposed patches to keep the same performances on
architectures that does not implement cmpxchg_local.
Add have_arch_cmpxchg(), which can be used within the body of functions to
select between irq disable and local_cmpxchg.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
---
include/linux/hardirq.h | 6 ++++++
1 file changed, 6 insertions(+)
Index: slab/include/linux/hardirq.h
===================================================================
--- slab.orig/include/linux/hardirq.h 2007-08-22 10:27:07.000000000 -0400
+++ slab/include/linux/hardirq.h 2007-08-22 10:27:46.000000000 -0400
@@ -149,4 +149,10 @@ extern void irq_exit(void);
#define nmi_enter() do { lockdep_off(); __irq_enter(); } while (0)
#define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0)
+#ifdef __HAVE_ARCH_CMPXCHG
+#define have_arch_cmpxchg() 1
+#else
+#define have_arch_cmpxchg() 0
+#endif
+
#endif /* LINUX_HARDIRQ_H */
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists