From: Waiman Long <Waiman.Long@hp.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
David Howells <dhowells@redhat.com>,
Dave Jones <davej@redhat.com>,
Clark Williams <williams@redhat.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: Waiman Long <Waiman.Long@hp.com>,
linux-kernel@vger.kernel.org, x86@kernel.org,
linux-arch@vger.kernel.org, "Chandramouleeswaran,
Aswin" <aswin@hp.com>, Davidlohr Bueso <davidlohr.bueso@hp.com>,
"Norton, Scott J" <scott.norton@hp.com>,
Rik van Riel <riel@redhat.com>
Subject: [PATCH v3 4/5] mutex: Remove new typedefs introduced in patch 2
Date: Wed, 17 Apr 2013 00:28:10 -0400 [thread overview]
Message-ID: <1366172891-7729-5-git-send-email-Waiman.Long@hp.com> (raw)
In-Reply-To: <1366172891-7729-1-git-send-email-Waiman.Long@hp.com>
In response to the review comment from Davidlohr, this patch will
remove the new typedefs introduced by patch 2. It also removes an
unnecessary barrier() call.
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
kernel/mutex.c | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/kernel/mutex.c b/kernel/mutex.c
index 5600bdf..140f113 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -113,18 +113,16 @@ EXPORT_SYMBOL(mutex_lock);
* We don't inline mspin_lock() so that perf can correctly account for the
* time spent in this lock function.
*/
-typedef struct mspin_node {
- struct mspin_node *next;
- int locked; /* 1 if lock acquired */
-} mspin_node_t;
-
-typedef mspin_node_t *mspin_lock_t;
-
-#define MLOCK(mutex) ((mspin_lock_t *)&((mutex)->spin_mlock))
-
-static noinline void mspin_lock(mspin_lock_t *lock, mspin_node_t *node)
+struct mspin_node {
+ struct mspin_node *next ;
+ int locked; /* 1 if lock acquired */
+};
+#define MLOCK(mutex) ((struct mspin_node **)&((mutex)->spin_mlock))
+
+static noinline
+void mspin_lock(struct mspin_node **lock, struct mspin_node *node)
{
- mspin_node_t *prev;
+ struct mspin_node *prev;
/* Init node */
node->locked = 0;
@@ -143,9 +141,9 @@ static noinline void mspin_lock(mspin_lock_t *lock, mspin_node_t *node)
arch_mutex_cpu_relax();
}
-static void mspin_unlock(mspin_lock_t *lock, mspin_node_t *node)
+static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
{
- mspin_node_t *next = ACCESS_ONCE(node->next);
+ struct mspin_node *next = ACCESS_ONCE(node->next);
if (likely(!next)) {
/*
@@ -157,7 +155,6 @@ static void mspin_unlock(mspin_lock_t *lock, mspin_node_t *node)
while (!(next = ACCESS_ONCE(node->next)))
arch_mutex_cpu_relax();
}
- barrier();
ACCESS_ONCE(next->locked) = 1;
smp_wmb();
}
@@ -237,7 +234,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
for (;;) {
struct task_struct *owner;
- mspin_node_t node;
+ struct mspin_node node;
/*
* If there's an owner, wait for it to either
--
1.7.1
next prev parent reply other threads:[~2013-04-17 4:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 4:28 [PATCH v3 0/5] mutex: Improve mutex performance by doing less atomic-ops & better spinning Waiman Long
2013-04-17 4:28 ` [PATCH v3 1/5] mutex: Make more scalable by doing less atomic operations Waiman Long
2013-04-17 4:28 ` [PATCH v3 2/5] mutex: Queue mutex spinners with MCS lock to reduce cacheline contention Waiman Long
2013-04-17 4:28 ` [PATCH v3 optional 3/5] mutex: back out architecture specific check for negative mutex count Waiman Long
2013-04-17 4:28 ` Waiman Long [this message]
2013-04-17 7:17 ` [PATCH v3 4/5] mutex: Remove new typedefs introduced in patch 2 Ingo Molnar
2013-04-17 4:28 ` [PATCH v3 5/5] mutex: Move mutex spinning code from sched/core.c back to mutex.c Waiman Long
2013-04-17 7:18 ` Ingo Molnar
2013-04-17 19:28 ` Waiman Long
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=1366172891-7729-5-git-send-email-Waiman.Long@hp.com \
--to=waiman.long@hp.com \
--cc=aswin@hp.com \
--cc=davej@redhat.com \
--cc=davidlohr.bueso@hp.com \
--cc=dhowells@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=scott.norton@hp.com \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
--cc=x86@kernel.org \
/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®