* [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read() @ 2021-04-06 22:19 Andrew Halaney 2021-04-26 16:42 ` Andrew Halaney 0 siblings, 1 reply; 5+ messages in thread From: Andrew Halaney @ 2021-04-06 22:19 UTC (permalink / raw) To: bigeasy; +Cc: linux-kernel, linux-rt-users, Andrew Halaney, Chunyu Hu 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> --- Hello, 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. Thanks, Andrew 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)) return; - might_sleep(); raw_spin_lock_irq(&m->wait_lock); /* * Wake the writer, i.e. the rtmutex owner. It might release the -- 2.30.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read() 2021-04-06 22:19 [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read() Andrew Halaney @ 2021-04-26 16:42 ` Andrew Halaney 2021-04-26 18:16 ` Thomas Gleixner 0 siblings, 1 reply; 5+ messages in thread From: Andrew Halaney @ 2021-04-26 16:42 UTC (permalink / raw) To: bigeasy; +Cc: linux-kernel, linux-rt-users, Chunyu Hu On Tue, Apr 06, 2021 at 05:19:52PM -0500, Andrew Halaney wrote: > 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> > --- > Hello, > > 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. > > Thanks, > Andrew > > 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)) > return; > > - might_sleep(); > raw_spin_lock_irq(&m->wait_lock); > /* > * Wake the writer, i.e. the rtmutex owner. It might release the > -- > 2.30.2 > Just a gentle follow up, any feedback? Thanks, Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read() 2021-04-26 16:42 ` Andrew Halaney @ 2021-04-26 18:16 ` Thomas Gleixner 2021-07-08 19:51 ` Andrew Halaney 0 siblings, 1 reply; 5+ messages in thread From: Thomas Gleixner @ 2021-04-26 18:16 UTC (permalink / raw) To: Andrew Halaney, bigeasy; +Cc: linux-kernel, linux-rt-users, Chunyu Hu On Mon, Apr 26 2021 at 11:42, Andrew Halaney wrote: > On Tue, Apr 06, 2021 at 05:19:52PM -0500, Andrew Halaney wrote: >> 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> >> --- >> Hello, >> >> 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. >> >> Thanks, >> Andrew >> >> 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)) >> return; >> >> - might_sleep(); >> raw_spin_lock_irq(&m->wait_lock); >> /* >> * Wake the writer, i.e. the rtmutex owner. It might release the >> -- >> 2.30.2 > > Just a gentle follow up, any feedback? Looks correct. Will go into the next rt-release. Thanks, tglx ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read() 2021-04-26 18:16 ` Thomas Gleixner @ 2021-07-08 19:51 ` Andrew Halaney 2021-07-09 13:48 ` Thomas Gleixner 0 siblings, 1 reply; 5+ messages in thread From: Andrew Halaney @ 2021-07-08 19:51 UTC (permalink / raw) To: Thomas Gleixner; +Cc: bigeasy, linux-kernel, linux-rt-users, Chunyu Hu On Mon, Apr 26, 2021 at 08:16:34PM +0200, Thomas Gleixner wrote: > On Mon, Apr 26 2021 at 11:42, Andrew Halaney wrote: > > On Tue, Apr 06, 2021 at 05:19:52PM -0500, Andrew Halaney wrote: > >> 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> > >> --- > >> Hello, > >> > >> 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. > >> > >> Thanks, > >> Andrew > >> > >> 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)) > >> return; > >> > >> - might_sleep(); > >> raw_spin_lock_irq(&m->wait_lock); > >> /* > >> * Wake the writer, i.e. the rtmutex owner. It might release the > >> -- > >> 2.30.2 > > > > Just a gentle follow up, any feedback? > > Looks correct. Will go into the next rt-release. > > Thanks, > > tglx > Hi Thomas, I see a new release (v5.13-rt1) was created, and with it rwsem was overhauled entirely making this patch pointless for linux-rt-devel. That being said, it's a little unclear to me how RT only patches make their way to the maintained branches over in linux-stable-rt. I think it should be applied to: v4.9-rt v4.14-rt v4.19-rt v5.4-rt v5.10-rt to remove the incorrect warning, unless those branches plan to backport the latest RT patchset with the new rwsem implementation. Is there a proper way for me signal that? Thanks, Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read() 2021-07-08 19:51 ` Andrew Halaney @ 2021-07-09 13:48 ` Thomas Gleixner 0 siblings, 0 replies; 5+ messages in thread From: Thomas Gleixner @ 2021-07-09 13:48 UTC (permalink / raw) To: Andrew Halaney Cc: bigeasy, linux-kernel, linux-rt-users, Chunyu Hu, stable-rt Andrew, On Thu, Jul 08 2021 at 14:51, Andrew Halaney wrote: Cc+ stable-rt folks and leave context untrimmed. > On Mon, Apr 26, 2021 at 08:16:34PM +0200, Thomas Gleixner wrote: >> On Mon, Apr 26 2021 at 11:42, Andrew Halaney wrote: >> > On Tue, Apr 06, 2021 at 05:19:52PM -0500, Andrew Halaney wrote: >> >> 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> >> >> --- >> >> Hello, >> >> >> >> 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. >> >> >> >> Thanks, >> >> Andrew >> >> >> >> 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)) >> >> return; >> >> >> >> - might_sleep(); >> >> raw_spin_lock_irq(&m->wait_lock); >> >> /* >> >> * Wake the writer, i.e. the rtmutex owner. It might release the >> >> -- >> >> 2.30.2 >> > >> > Just a gentle follow up, any feedback? >> >> Looks correct. Will go into the next rt-release. >> >> Thanks, >> >> tglx >> > > Hi Thomas, > > I see a new release (v5.13-rt1) was created, and with it rwsem > was overhauled entirely making this patch pointless for linux-rt-devel. > > That being said, it's a little unclear to me how RT only patches > make their way to the maintained branches over in linux-stable-rt. > I think it should be applied to: > v4.9-rt > v4.14-rt > v4.19-rt > v5.4-rt > v5.10-rt > to remove the incorrect warning, unless those branches plan to backport > the latest RT patchset with the new rwsem implementation. Is there a > proper way for me signal that? See Cc. Thanks, tglx ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-07-09 13:48 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-04-06 22:19 [RT PATCH] locking/rwsem-rt: Remove might_sleep() in __up_read() Andrew Halaney 2021-04-26 16:42 ` Andrew Halaney 2021-04-26 18:16 ` Thomas Gleixner 2021-07-08 19:51 ` Andrew Halaney 2021-07-09 13:48 ` Thomas Gleixner
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).