linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zanussi@kernel.org
To: LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Daniel Wagner <wagi@monom.org>,
	Clark Williams <williams@redhat.com>,
	"Luis Claudio R. Goncalves" <lgoncalv@redhat.com>,
	Tom Zanussi <zanussi@kernel.org>
Cc: Andrew Halaney <ahalaney@redhat.com>
Subject: [PATCH RT 1/2] locking/rwsem-rt: Remove might_sleep() in __up_read()
Date: Thu,  2 Sep 2021 15:26:30 -0500	[thread overview]
Message-ID: <215c9e668bc1b637529e877fedfc7dc6c54c4ca0.1630614380.git.zanussi@kernel.org> (raw)
In-Reply-To: <cover.1630614380.git.zanussi@kernel.org>
In-Reply-To: <cover.1630614380.git.zanussi@kernel.org>

From: Andrew Halaney <ahalaney@redhat.com>

v5.4.143-rt64-rc1 stable review patch.
If anyone has any objections, please let me know.

-----------


[ Upstream commit b2ed0a4302faf2bb09e97529dd274233c082689b ]

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 <chuhu@redhat.com>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
---
 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 19ea20be3fd7..966946454ced 100644
--- a/kernel/locking/rwsem-rt.c
+++ b/kernel/locking/rwsem-rt.c
@@ -200,7 +200,6 @@ void __up_read(struct rw_semaphore *sem)
 	if (!atomic_dec_and_test(&sem->readers))
 		return;
 
-	might_sleep();
 	raw_spin_lock_irq(&m->wait_lock);
 	/*
 	 * Wake the writer, i.e. the rtmutex owner. It might release the
-- 
2.17.1


  reply	other threads:[~2021-09-02 20:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 20:26 [PATCH RT 0/2] Linux v5.4.143-rt64-rc1 zanussi
2021-09-02 20:26 ` zanussi [this message]
2021-09-02 20:26 ` [PATCH RT 2/2] Linux 5.4.143-rt64-rc1 zanussi
  -- strict thread matches above, loose matches on Subject: below --
2021-08-20 23:46 [PATCH RT 0/2] Linux 5.10.59-rt52-rc1 Steven Rostedt
2021-08-20 23:46 ` [PATCH RT 1/2] locking/rwsem-rt: Remove might_sleep() in __up_read() Steven Rostedt

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=215c9e668bc1b637529e877fedfc7dc6c54c4ca0.1630614380.git.zanussi@kernel.org \
    --to=zanussi@kernel.org \
    --cc=C.Emde@osadl.org \
    --cc=ahalaney@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=jkacur@redhat.com \
    --cc=lgoncalv@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=wagi@monom.org \
    --cc=williams@redhat.com \
    /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).