From: Ingo Molnar <mingo@elte.hu>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Arjan van de Ven <arjanv@infradead.org>,
Nicolas Pitre <nico@cam.org>,
Jes Sorensen <jes@trained-monkey.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
Oleg Nesterov <oleg@tv-sign.ru>,
David Howells <dhowells@redhat.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Benjamin LaHaise <bcrl@kvack.org>,
Steven Rostedt <rostedt@goodmis.org>,
Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@suse.de>,
Russell King <rmk+lkml@arm.linux.org.uk>
Subject: [patch 6/9] mutex subsystem, switch ARM to use the xchg based implementation
Date: Thu, 22 Dec 2005 12:42:40 +0100 [thread overview]
Message-ID: <20051222114240.GG18878@elte.hu> (raw)
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;
reply other threads:[~2005-12-22 11:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051222114240.GG18878@elte.hu \
--to=mingo@elte.hu \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjanv@infradead.org \
--cc=bcrl@kvack.org \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=jes@trained-monkey.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nico@cam.org \
--cc=oleg@tv-sign.ru \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=rostedt@goodmis.org \
--cc=torvalds@osdl.org \
--cc=zwane@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®