[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1366172891-7729-5-git-send-email-Waiman.Long@hp.com>
Date: Wed, 17 Apr 2013 00:28:10 -0400
From: Waiman Long <Waiman.Long@...com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
David Howells <dhowells@...hat.com>,
Dave Jones <davej@...hat.com>,
Clark Williams <williams@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Waiman Long <Waiman.Long@...com>, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-arch@...r.kernel.org,
"Chandramouleeswaran, Aswin" <aswin@...com>,
Davidlohr Bueso <davidlohr.bueso@...com>,
"Norton, Scott J" <scott.norton@...com>,
Rik van Riel <riel@...hat.com>
Subject: [PATCH v3 4/5] mutex: Remove new typedefs introduced in patch 2
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@...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
--
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