From: Mike Galbraith <efault@gmx.de>
To: Gratian Crisan <gratian.crisan@ni.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
Brandon Streiff <brandon.streiff@ni.com>,
Ingo Molnar <mingo@redhat.com>,
Darren Hart <dvhart@infradead.org>,
James Minor <james.minor@ni.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: BUG_ON(!newowner) in fixup_pi_state_owner()
Date: Wed, 04 Nov 2020 08:42:36 +0100 [thread overview]
Message-ID: <5f536491708682fc3b86cb5b7bc1e05ffa3521e7.camel@gmx.de> (raw)
In-Reply-To: <2376f4e71c638aee215a4911e5efed14c5adf56e.camel@gmx.de>
On Wed, 2020-11-04 at 01:56 +0100, Mike Galbraith wrote:
> On Tue, 2020-11-03 at 17:31 -0600, Gratian Crisan wrote:
> > Hi all,
> >
> > I apologize for waking up the futex demons (and replying to my own
> > email), but ...
> >
> > Gratian Crisan writes:
> > >
> > > Brandon and I have been debugging a nasty race that leads to
> > > BUG_ON(!newowner) in fixup_pi_state_owner() in futex.c. So far
> > > we've only been able to reproduce the issue on 4.9.y-rt kernels.
> > > We are still testing if this is a problem for later RT branches.
> >
> > I was able to reproduce the BUG_ON(!newowner) in fixup_pi_state_owner()
> > with a 5.10.0-rc1-rt1 kernel (currently testing 5.10.0-rc2-rt4).
>
> My box says it's generic.
---
kernel/futex.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2383,7 +2383,18 @@ static int fixup_pi_state_owner(u32 __us
* Since we just failed the trylock; there must be an owner.
*/
newowner = rt_mutex_owner(&pi_state->pi_mutex);
- BUG_ON(!newowner);
+
+ /*
+ * Why? Because I know what I'm doing with these beasts? Nope,
+ * but what the hell, a busy restart loop let f_boosted become
+ * owner, so go for it. Box still boots, works, no longer makes
+ * boom with fbomb_v2, and as an added bonus, didn't even blow
+ * futextests all up. Maybe it'll help... or not, we'll see.
+ */
+ if (unlikely(!newowner)) {
+ err = -EAGAIN;
+ goto handle_err;
+ }
} else {
WARN_ON_ONCE(argowner != current);
if (oldowner == current) {
next prev parent reply other threads:[~2020-11-04 7:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 23:24 Gratian Crisan
2020-11-03 23:31 ` Gratian Crisan
2020-11-04 0:56 ` Mike Galbraith
2020-11-04 7:42 ` Mike Galbraith [this message]
2020-11-04 10:24 ` Thomas Gleixner
2020-11-04 11:17 ` Thomas Gleixner
2020-11-04 13:26 ` Thomas Gleixner
2020-11-04 13:43 ` Mike Galbraith
2020-11-04 15:12 ` [PATCH] futex: Handle transient "ownerless" rtmutex state correctly Thomas Gleixner
2020-11-04 15:22 ` Thomas Gleixner
2020-11-04 16:50 ` Mike Galbraith
2020-11-05 6:32 ` Gratian Crisan
2020-11-04 10:00 ` BUG_ON(!newowner) in fixup_pi_state_owner() Thomas Gleixner
2020-11-06 21:26 ` [tip: locking/urgent] futex: Handle transient "ownerless" rtmutex state correctly tip-bot2 for Mike Galbraith
2020-11-07 17:05 ` Mike Galbraith
2020-11-07 21:07 ` Thomas Gleixner
2020-11-07 21:08 ` 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=5f536491708682fc3b86cb5b7bc1e05ffa3521e7.camel@gmx.de \
--to=efault@gmx.de \
--cc=bigeasy@linutronix.de \
--cc=brandon.streiff@ni.com \
--cc=dvhart@infradead.org \
--cc=gratian.crisan@ni.com \
--cc=james.minor@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®