linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] locking, rwsem: Add missing __init_rwsem() for PREEMPT_RT
@ 2021-08-31  6:38 Mike Galbraith
  2021-08-31  9:54 ` [tip: locking/urgent] locking/rwsem: " tip-bot2 for Mike Galbraith
  2021-09-02 20:14 ` tip-bot2 for Mike Galbraith
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Galbraith @ 2021-08-31  6:38 UTC (permalink / raw)
  To: LKML; +Cc: Thomas Gleixner


730633f0b7f95 became the first direct caller of __init_rwsem() vs the
usual init_rwsem(), exposing PREEMPT_RT's lack thereof.  Add it.

Signed-off-by: Mike Galbraith <efault@gmx.de>
---
 include/linux/rwsem.h |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -152,12 +152,18 @@ static inline void  __rwsem_init(struct
 }
 #endif

+static inline void __init_rwsem(struct rw_semaphore *sem, const char *name,
+				struct lock_class_key *key)
+{
+	init_rwbase_rt(&(sem)->rwbase);
+	__rwsem_init(sem, name, key);
+}
+
 #define init_rwsem(sem)						\
 do {								\
 	static struct lock_class_key __key;			\
 								\
-	init_rwbase_rt(&(sem)->rwbase);			\
-	__rwsem_init((sem), #sem, &__key);			\
+	__init_rwsem((sem), #sem, &__key);			\
 } while (0)

 static __always_inline int rwsem_is_locked(struct rw_semaphore *sem)


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

* [tip: locking/urgent] locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT
  2021-08-31  6:38 [patch] locking, rwsem: Add missing __init_rwsem() for PREEMPT_RT Mike Galbraith
@ 2021-08-31  9:54 ` tip-bot2 for Mike Galbraith
  2021-08-31 23:02   ` Mike Galbraith
  2021-09-02 20:14 ` tip-bot2 for Mike Galbraith
  1 sibling, 1 reply; 4+ messages in thread
From: tip-bot2 for Mike Galbraith @ 2021-08-31  9:54 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Mike Galbraith, Thomas Gleixner, x86, linux-kernel

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     453624fa68444c9b93addb4325c9db59b6a43e21
Gitweb:        https://git.kernel.org/tip/453624fa68444c9b93addb4325c9db59b6a43e21
Author:        Mike Galbraith <efault@gmx.de>
AuthorDate:    Tue, 31 Aug 2021 08:38:19 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 31 Aug 2021 11:53:12 +02:00

locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT

730633f0b7f95 became the first direct caller of __init_rwsem() vs the
usual init_rwsem(), exposing PREEMPT_RT's lack thereof.  Add it.

[ tglx: Move it out of line ]

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/50a936b7d8f12277d6ec7ed2ef0421a381056909.camel@gmx.de
---
 include/linux/rwsem.h  | 12 ++----------
 kernel/locking/rwsem.c |  8 +++++---
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 426e98e..352c612 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -142,22 +142,14 @@ struct rw_semaphore {
 #define DECLARE_RWSEM(lockname) \
 	struct rw_semaphore lockname = __RWSEM_INITIALIZER(lockname)
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-extern void  __rwsem_init(struct rw_semaphore *rwsem, const char *name,
+extern void  __init_rwsem(struct rw_semaphore *rwsem, const char *name,
 			  struct lock_class_key *key);
-#else
-static inline void  __rwsem_init(struct rw_semaphore *rwsem, const char *name,
-				 struct lock_class_key *key)
-{
-}
-#endif
 
 #define init_rwsem(sem)						\
 do {								\
 	static struct lock_class_key __key;			\
 								\
-	init_rwbase_rt(&(sem)->rwbase);			\
-	__rwsem_init((sem), #sem, &__key);			\
+	__init_rwsem((sem), #sem, &__key);			\
 } while (0)
 
 static __always_inline int rwsem_is_locked(struct rw_semaphore *sem)
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index 9215b4d..f18bbe8 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -1376,15 +1376,17 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
 
 #include "rwbase_rt.c"
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
 void __rwsem_init(struct rw_semaphore *sem, const char *name,
 		  struct lock_class_key *key)
 {
+	init_rwbase_rt(&(sem)->rwbase);
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
 	debug_check_no_locks_freed((void *)sem, sizeof(*sem));
 	lockdep_init_map_wait(&sem->dep_map, name, key, 0, LD_WAIT_SLEEP);
-}
-EXPORT_SYMBOL(__rwsem_init);
 #endif
+}
+EXPORT_SYMBOL(__init_rwsem);
 
 static inline void __down_read(struct rw_semaphore *sem)
 {

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

* Re: [tip: locking/urgent] locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT
  2021-08-31  9:54 ` [tip: locking/urgent] locking/rwsem: " tip-bot2 for Mike Galbraith
@ 2021-08-31 23:02   ` Mike Galbraith
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Galbraith @ 2021-08-31 23:02 UTC (permalink / raw)
  To: linux-kernel, linux-tip-commits; +Cc: Thomas Gleixner, x86

On Tue, 2021-08-31 at 09:54 +0000, tip-bot2 for Mike Galbraith wrote:
> --- a/kernel/locking/rwsem.c
> +++ b/kernel/locking/rwsem.c
> @@ -1376,15 +1376,17 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
>  
>  #include "rwbase_rt.c"
>  
> -#ifdef CONFIG_DEBUG_LOCK_ALLOC
>  void __rwsem_init(struct rw_semaphore *sem, const char *name,
        ^^^^^^^^^^^^ this line dodged your key tapping.

	-Mike

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

* [tip: locking/urgent] locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT
  2021-08-31  6:38 [patch] locking, rwsem: Add missing __init_rwsem() for PREEMPT_RT Mike Galbraith
  2021-08-31  9:54 ` [tip: locking/urgent] locking/rwsem: " tip-bot2 for Mike Galbraith
@ 2021-09-02 20:14 ` tip-bot2 for Mike Galbraith
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Mike Galbraith @ 2021-09-02 20:14 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Mike Galbraith, Thomas Gleixner, x86, linux-kernel

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     15eb7c888e749fbd1cc0370f3d38de08ad903700
Gitweb:        https://git.kernel.org/tip/15eb7c888e749fbd1cc0370f3d38de08ad903700
Author:        Mike Galbraith <efault@gmx.de>
AuthorDate:    Tue, 31 Aug 2021 08:38:19 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 02 Sep 2021 22:07:17 +02:00

locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT

730633f0b7f95 became the first direct caller of __init_rwsem() vs the
usual init_rwsem(), exposing PREEMPT_RT's lack thereof.  Add it.

[ tglx: Move it out of line ]

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/50a936b7d8f12277d6ec7ed2ef0421a381056909.camel@gmx.de

---
 include/linux/rwsem.h  | 12 ++----------
 kernel/locking/rwsem.c | 10 ++++++----
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 426e98e..352c612 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -142,22 +142,14 @@ struct rw_semaphore {
 #define DECLARE_RWSEM(lockname) \
 	struct rw_semaphore lockname = __RWSEM_INITIALIZER(lockname)
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-extern void  __rwsem_init(struct rw_semaphore *rwsem, const char *name,
+extern void  __init_rwsem(struct rw_semaphore *rwsem, const char *name,
 			  struct lock_class_key *key);
-#else
-static inline void  __rwsem_init(struct rw_semaphore *rwsem, const char *name,
-				 struct lock_class_key *key)
-{
-}
-#endif
 
 #define init_rwsem(sem)						\
 do {								\
 	static struct lock_class_key __key;			\
 								\
-	init_rwbase_rt(&(sem)->rwbase);			\
-	__rwsem_init((sem), #sem, &__key);			\
+	__init_rwsem((sem), #sem, &__key);			\
 } while (0)
 
 static __always_inline int rwsem_is_locked(struct rw_semaphore *sem)
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index 9215b4d..000e8d5 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -1376,15 +1376,17 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
 
 #include "rwbase_rt.c"
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-void __rwsem_init(struct rw_semaphore *sem, const char *name,
+void __init_rwsem(struct rw_semaphore *sem, const char *name,
 		  struct lock_class_key *key)
 {
+	init_rwbase_rt(&(sem)->rwbase);
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
 	debug_check_no_locks_freed((void *)sem, sizeof(*sem));
 	lockdep_init_map_wait(&sem->dep_map, name, key, 0, LD_WAIT_SLEEP);
-}
-EXPORT_SYMBOL(__rwsem_init);
 #endif
+}
+EXPORT_SYMBOL(__init_rwsem);
 
 static inline void __down_read(struct rw_semaphore *sem)
 {

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

end of thread, other threads:[~2021-09-02 20:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31  6:38 [patch] locking, rwsem: Add missing __init_rwsem() for PREEMPT_RT Mike Galbraith
2021-08-31  9:54 ` [tip: locking/urgent] locking/rwsem: " tip-bot2 for Mike Galbraith
2021-08-31 23:02   ` Mike Galbraith
2021-09-02 20:14 ` tip-bot2 for Mike Galbraith

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).