linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -tip 1/3] locking/qrwlock: Rename ->lock to ->wait_lock
@ 2015-09-14  7:37 Davidlohr Bueso
  2015-09-14  7:37 ` [PATCH -tip 2/3] sched/wake_q: Relax to acquire semantics Davidlohr Bueso
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Davidlohr Bueso @ 2015-09-14  7:37 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Thomas Gleixner
  Cc: Paul E. McKenney, Davidlohr Bueso, linux-kernel, Davidlohr Bueso

... trivial, but reads a little nicer when we name our
actual primitive 'lock'.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
 include/asm-generic/qrwlock_types.h | 4 ++--
 kernel/locking/qrwlock.c            | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h
index 4d76f24..0abc6b6 100644
--- a/include/asm-generic/qrwlock_types.h
+++ b/include/asm-generic/qrwlock_types.h
@@ -10,12 +10,12 @@
 
 typedef struct qrwlock {
 	atomic_t		cnts;
-	arch_spinlock_t		lock;
+	arch_spinlock_t		wait_lock;
 } arch_rwlock_t;
 
 #define	__ARCH_RW_LOCK_UNLOCKED {		\
 	.cnts = ATOMIC_INIT(0),			\
-	.lock = __ARCH_SPIN_LOCK_UNLOCKED,	\
+	.wait_lock = __ARCH_SPIN_LOCK_UNLOCKED,	\
 }
 
 #endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */
diff --git a/kernel/locking/qrwlock.c b/kernel/locking/qrwlock.c
index f17a3e3..fec0823 100644
--- a/kernel/locking/qrwlock.c
+++ b/kernel/locking/qrwlock.c
@@ -86,7 +86,7 @@ void queued_read_lock_slowpath(struct qrwlock *lock, u32 cnts)
 	/*
 	 * Put the reader into the wait queue
 	 */
-	arch_spin_lock(&lock->lock);
+	arch_spin_lock(&lock->wait_lock);
 
 	/*
 	 * The ACQUIRE semantics of the following spinning code ensure
@@ -99,7 +99,7 @@ void queued_read_lock_slowpath(struct qrwlock *lock, u32 cnts)
 	/*
 	 * Signal the next one in queue to become queue head
 	 */
-	arch_spin_unlock(&lock->lock);
+	arch_spin_unlock(&lock->wait_lock);
 }
 EXPORT_SYMBOL(queued_read_lock_slowpath);
 
@@ -112,7 +112,7 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
 	u32 cnts;
 
 	/* Put the writer into the wait queue */
-	arch_spin_lock(&lock->lock);
+	arch_spin_lock(&lock->wait_lock);
 
 	/* Try to acquire the lock directly if no reader is present */
 	if (!atomic_read(&lock->cnts) &&
@@ -144,6 +144,6 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
 		cpu_relax_lowlatency();
 	}
 unlock:
-	arch_spin_unlock(&lock->lock);
+	arch_spin_unlock(&lock->wait_lock);
 }
 EXPORT_SYMBOL(queued_write_lock_slowpath);
-- 
2.1.4


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

end of thread, other threads:[~2015-09-25 21:39 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-14  7:37 [PATCH -tip 1/3] locking/qrwlock: Rename ->lock to ->wait_lock Davidlohr Bueso
2015-09-14  7:37 ` [PATCH -tip 2/3] sched/wake_q: Relax to acquire semantics Davidlohr Bueso
2015-09-14 12:32   ` Peter Zijlstra
2015-09-14 21:08     ` Davidlohr Bueso
2015-09-15  9:49       ` Peter Zijlstra
2015-09-15  9:55         ` Peter Zijlstra
2015-09-15 12:41           ` Paul E. McKenney
2015-09-15 12:48             ` Peter Zijlstra
2015-09-15 14:09               ` Paul E. McKenney
2015-09-15 14:14                 ` Peter Zijlstra
2015-09-15 15:34                   ` Paul E. McKenney
2015-09-15 16:30                     ` Peter Zijlstra
2015-09-15 17:09                       ` Paul E. McKenney
2015-09-18 21:41                         ` Paul E. McKenney
2015-09-21  9:22                           ` Martin Schwidefsky
2015-09-22 10:27                             ` Martin Schwidefsky
2015-09-22 12:23                               ` Boqun Feng
2015-09-22 12:51                                 ` Martin Schwidefsky
2015-09-22 13:29                                   ` Boqun Feng
2015-09-22 14:33                                     ` Martin Schwidefsky
2015-09-22 15:28                                       ` Paul E. McKenney
2015-09-23  6:43                                         ` Martin Schwidefsky
2015-09-25 21:30                                           ` Paul E. McKenney
2015-09-15 19:49           ` Davidlohr Bueso
2015-09-16  9:01             ` Peter Zijlstra
2015-09-14  7:37 ` [PATCH -tip 3/3] locking/osq: Relax atomic semantics Davidlohr Bueso
2015-09-18  8:50   ` [tip:locking/core] " tip-bot for Davidlohr Bueso
2015-09-18  8:50 ` [tip:locking/core] locking/qrwlock: Rename ->lock to ->wait_lock tip-bot for Davidlohr Bueso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).