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

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