Linux-rt-users Archive on
 help / color / Atom feed
From: Andrew Halaney <>
	Andrew Halaney <>,
	Chunyu Hu <>
Subject: [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read()
Date: Tue,  6 Apr 2021 17:19:52 -0500
Message-ID: <> (raw)

There's no chance of sleeping here, the reader is giving up the
lock and possibly waking up the writer who is waiting on it.

Reported-by: Chunyu Hu <>
Signed-off-by: Andrew Halaney <>

I ran into a warning caused by this, and I think the warning is
incorrect. Please let me know if I'm wrong!
I'm working off of linux-5.12.y-rt, but this applies cleanly to older
stable branches as well.


 kernel/locking/rwsem-rt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c
index 274172d5bb3a..b61edc4dcb73 100644
--- a/kernel/locking/rwsem-rt.c
+++ b/kernel/locking/rwsem-rt.c
@@ -198,7 +198,6 @@ void __up_read(struct rw_semaphore *sem)
 	if (!atomic_dec_and_test(&sem->readers))
-	might_sleep();
 	 * Wake the writer, i.e. the rtmutex owner. It might release the

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 22:19 Andrew Halaney [this message]
2021-04-26 16:42 ` Andrew Halaney
2021-04-26 18:16   ` Thomas Gleixner

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:

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

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-rt-users Archive on

Archives are clonable:
	git clone --mirror linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ \
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone