mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 6/9] mutex subsystem, switch ARM to use the xchg based implementation
@ 2005-12-22 11:42 Ingo Molnar
  0 siblings, 0 replies; only message in thread
From: Ingo Molnar @ 2005-12-22 11:42 UTC (permalink / raw)
  To: lkml
  Cc: Linus Torvalds, Andrew Morton, Arjan van de Ven, Nicolas Pitre,
	Jes Sorensen, Zwane Mwaikambo, Oleg Nesterov, David Howells,
	Alan Cox, Benjamin LaHaise, Steven Rostedt, Christoph Hellwig,
	Andi Kleen, Russell King

as noted by Nicolas Pitre, atomic_[inc/dec]_call_if_[nonpositive/negative]()
atomic methods are slow on ARM, because they can only be implemented via
disabling interrupts. So tell the mutex code that we prefer atomic_xchg().

[ we still pull in asm-generic/atomic-call-if.h, so that they remain
  generally available primitives - even though unused on ARM at the
  moment. ]

Signed-off-by: Ingo Molnar <mingo@elte.hu>

----

 include/asm-arm/atomic.h |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

Index: linux/include/asm-arm/atomic.h
===================================================================
--- linux.orig/include/asm-arm/atomic.h
+++ linux/include/asm-arm/atomic.h
@@ -180,14 +180,16 @@ static inline void atomic_clear_mask(uns
 /*
  * Pull in the generic wrappers for atomic_dec_call_if_negative() and
  * atomic_inc_call_if_nonpositive().
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or use the __ARCH_WANT_XCHG_BASED_ATOMICS
- * mechanism to tell the generic mutex code to use the atomic_xchg()
- * based fastpath implementation.
  */
 #include <asm-generic/atomic-call-if.h>
 
+/*
+ * The atomic_[inc/dec]_call_if_[nonpositive/negative]() atomic methods
+ * are slow on ARM, because they can only be implemented via disabling
+ * interrupts. Tell the mutex code that we prefer atomic_xchg():
+ */
+#define __ARCH_WANT_XCHG_BASED_ATOMICS
+
 static inline int atomic_add_unless(atomic_t *v, int a, int u)
 {
 	int c, old;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-22 11:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-22 11:42 [patch 6/9] mutex subsystem, switch ARM to use the xchg based implementation Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®