linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Subject: [patch] locking, rwsem: Add missing __init_rwsem() for PREEMPT_RT
Date: Tue, 31 Aug 2021 08:38:19 +0200	[thread overview]
Message-ID: <50a936b7d8f12277d6ec7ed2ef0421a381056909.camel@gmx.de> (raw)


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)


             reply	other threads:[~2021-08-31  6:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  6:38 Mike Galbraith [this message]
2021-08-31  9:54 ` [tip: locking/urgent] locking/rwsem: Add missing __init_rwsem() for PREEMPT_RT tip-bot2 for Mike Galbraith
2021-08-31 23:02   ` Mike Galbraith
2021-09-02 20:14 ` tip-bot2 for Mike Galbraith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50a936b7d8f12277d6ec7ed2ef0421a381056909.camel@gmx.de \
    --to=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).