public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip/master 1/7] locking/mutex: Unify arguments in lock/unlock slowpaths
@ 2014-07-28  5:18 Davidlohr Bueso
  2014-07-28  5:18 ` [PATCH -tip/master 2/7] locking/mutex: Document quick lock release when unlocking Davidlohr Bueso
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Davidlohr Bueso @ 2014-07-28  5:18 UTC (permalink / raw)
  To: peterz, mingo; +Cc: jason.low2, davidlohr, aswin, linux-kernel

Just how the locking-end behaves, when unlocking, go ahead and
obtain the proper data structure immediately after the previous
(asm-end) call exits and there are (probably) pending waiters.
This simplifies a bit some of the layering.

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
---
 kernel/locking/mutex.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index ae712b2..ad0e333 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -679,9 +679,8 @@ EXPORT_SYMBOL_GPL(__ww_mutex_lock_interruptible);
  * Release the lock, slowpath:
  */
 static inline void
-__mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
+__mutex_unlock_common_slowpath(struct mutex *lock, int nested)
 {
-	struct mutex *lock = container_of(lock_count, struct mutex, count);
 	unsigned long flags;
 
 	/*
@@ -716,7 +715,9 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
 __visible void
 __mutex_unlock_slowpath(atomic_t *lock_count)
 {
-	__mutex_unlock_common_slowpath(lock_count, 1);
+	struct mutex *lock = container_of(lock_count, struct mutex, count);
+
+	__mutex_unlock_common_slowpath(lock, 1);
 }
 
 #ifndef CONFIG_DEBUG_LOCK_ALLOC
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2014-07-30 18:20 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-28  5:18 [PATCH -tip/master 1/7] locking/mutex: Unify arguments in lock/unlock slowpaths Davidlohr Bueso
2014-07-28  5:18 ` [PATCH -tip/master 2/7] locking/mutex: Document quick lock release when unlocking Davidlohr Bueso
2014-07-30 15:10   ` Jason Low
2014-07-30 18:20     ` Davidlohr Bueso
2014-07-28  5:18 ` [PATCH -tip/master 3/7] locking/mcs: Remove obsolete comment Davidlohr Bueso
2014-07-28 16:49   ` Jason Low
2014-07-28 16:53     ` Davidlohr Bueso
2014-07-28 16:57       ` Peter Zijlstra
2014-07-28 17:19         ` Jason Low
2014-07-28 16:54     ` Peter Zijlstra
2014-07-28 17:49       ` Jason Low
2014-07-28 18:50         ` Peter Zijlstra
2014-07-28 21:02           ` Jason Low
2014-07-30 15:11   ` Jason Low
2014-07-28  5:18 ` [PATCH -tip/master 4/7] locking/mutex: Refactor optimistic spinning code Davidlohr Bueso
2014-07-28  9:08   ` Peter Zijlstra
2014-07-28 16:39     ` Jason Low
2014-07-28 16:41       ` Davidlohr Bueso
2014-07-29  2:55   ` [PATCH -tip/master v2] " Davidlohr Bueso
2014-07-29  3:41     ` Jason Low
2014-07-29  4:31       ` Davidlohr Bueso
2014-07-29  4:51   ` [PATCH -tip/master v3] " Davidlohr Bueso
2014-07-30 15:18   ` [PATCH -tip/master 4/7] " Jason Low
2014-07-28  5:18 ` [PATCH -tip/master 5/7] locking/mutex: Use MUTEX_SPIN_ON_OWNER when appropriate Davidlohr Bueso
2014-07-30 15:19   ` Jason Low
2014-07-28  5:18 ` [PATCH 6/7] locking: Move docs into Documentation/locking/ Davidlohr Bueso
2014-07-28  5:18 ` [PATCH -tip/master 7/7] Documentation: Update locking/mutex-design.txt disadvantages Davidlohr Bueso
2014-07-28 18:09   ` Jason Low

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