From: tip-bot for Waiman Long <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, williams@redhat.com, a.p.zijlstra@chello.nl,
torvalds@linux-foundation.org, peterz@infradead.org,
riel@redhat.com, Waiman.Long@hp.com, akpm@linux-foundation.org,
tglx@linutronix.de, scott.norton@hp.com,
linux-kernel@vger.kernel.org, hpa@zytor.com,
davidlohr.bueso@hp.com, davej@redhat.com,
paulmck@linux.vnet.ibm.com, dhowells@redhat.com, aswin@hp.com
Subject: [tip:core/locking] mutex: Back out architecture specific check for negative mutex count
Date: Fri, 19 Apr 2013 02:00:57 -0700 [thread overview]
Message-ID: <tip-cc189d2513d1f45cde87a9043fe3be28559c7490@git.kernel.org> (raw)
In-Reply-To: <1366226594-5506-5-git-send-email-Waiman.Long@hp.com>
Commit-ID: cc189d2513d1f45cde87a9043fe3be28559c7490
Gitweb: http://git.kernel.org/tip/cc189d2513d1f45cde87a9043fe3be28559c7490
Author: Waiman Long <Waiman.Long@hp.com>
AuthorDate: Wed, 17 Apr 2013 15:23:14 -0400
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 19 Apr 2013 09:33:36 +0200
mutex: Back out architecture specific check for negative mutex count
Linus suggested that probably all the supported architectures can
allow a negative mutex count without incorrect behavior, so we can
then back out the architecture specific change and allow the
mutex count to go to any negative number. That should further
reduce contention for non-x86 architecture.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Chandramouleeswaran Aswin <aswin@hp.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Norton Scott J <scott.norton@hp.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1366226594-5506-5-git-send-email-Waiman.Long@hp.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/mutex.h | 10 ----------
kernel/mutex.c | 9 ++-------
2 files changed, 2 insertions(+), 17 deletions(-)
diff --git a/arch/x86/include/asm/mutex.h b/arch/x86/include/asm/mutex.h
index bc2a0b0..7d3a482 100644
--- a/arch/x86/include/asm/mutex.h
+++ b/arch/x86/include/asm/mutex.h
@@ -3,13 +3,3 @@
#else
# include <asm/mutex_64.h>
#endif
-
-#ifndef __ASM_MUTEX_H
-#define __ASM_MUTEX_H
-/*
- * For the x86 architecture, it allows any negative number (besides -1) in
- * the mutex count to indicate that some other threads are waiting on the
- * mutex.
- */
-#define __ARCH_ALLOW_ANY_NEGATIVE_MUTEX_COUNT 1
-#endif
diff --git a/kernel/mutex.c b/kernel/mutex.c
index 1dbd421..ad53a66 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -38,15 +38,10 @@
#endif
/*
- * A mutex count of -1 indicates that waiters are sleeping waiting for the
- * mutex. Some architectures can allow any negative number, not just -1, for
- * this purpose.
+ * A negative mutex count indicates that waiters are sleeping waiting for the
+ * mutex.
*/
-#ifdef __ARCH_ALLOW_ANY_NEGATIVE_MUTEX_COUNT
#define MUTEX_SHOW_NO_WAITER(mutex) (atomic_read(&(mutex)->count) >= 0)
-#else
-#define MUTEX_SHOW_NO_WAITER(mutex) (atomic_read(&(mutex)->count) != -1)
-#endif
void
__mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key)
next prev parent reply other threads:[~2013-04-19 9:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 19:23 [PATCH v4 0/4] mutex: Improve mutex performance by doing less atomic-ops & better spinning Waiman Long
2013-04-17 19:23 ` [PATCH v4 1/4] mutex: Move mutex spinning code from sched/core.c back to mutex.c Waiman Long
2013-04-19 8:57 ` [tip:core/locking] mutex: Move mutex spinning code from sched/ core.c " tip-bot for Waiman Long
2013-04-17 19:23 ` [PATCH v4 2/4] mutex: Make more scalable by doing less atomic operations Waiman Long
2013-04-19 8:58 ` [tip:core/locking] " tip-bot for Waiman Long
2013-04-17 19:23 ` [PATCH v4 3/4] mutex: Queue mutex spinners with MCS lock to reduce cacheline contention Waiman Long
2013-04-18 3:00 ` Davidlohr Bueso
2013-04-19 8:59 ` [tip:core/locking] " tip-bot for Waiman Long
2013-04-17 19:23 ` [PATCH v4 optional 4/4] mutex: back out architecture specific check for negative mutex count Waiman Long
2013-04-19 9:00 ` tip-bot for Waiman Long [this message]
2013-04-19 7:37 ` [PATCH v4 0/4] mutex: Improve mutex performance by doing less atomic-ops & better spinning Ingo Molnar
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=tip-cc189d2513d1f45cde87a9043fe3be28559c7490@git.kernel.org \
--to=tipbot@zytor.com \
--cc=Waiman.Long@hp.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=aswin@hp.com \
--cc=davej@redhat.com \
--cc=davidlohr.bueso@hp.com \
--cc=dhowells@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=scott.norton@hp.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=williams@redhat.com \
/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
Powered by JetHome