From: Steven Rostedt <rostedt@goodmis.org>
To: peterz@infradead.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Joerg Vehlow <lkml@jv-coder.de>,
Thomas Gleixner <tglx@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Huang Ying <ying.huang@intel.com>,
linux-kernel@vger.kernel.org,
Joerg Vehlow <joerg.vehlow@aox-tech.de>,
dave@stgolabs.net
Subject: Re: [BUG RT] dump-capture kernel not executed for panic in interrupt context
Date: Sat, 22 Aug 2020 19:49:28 -0400 [thread overview]
Message-ID: <20200822194928.54ee4cb5@oasis.local.home> (raw)
In-Reply-To: <20200822123252.GQ1362448@hirez.programming.kicks-ass.net>
On Sat, 22 Aug 2020 14:32:52 +0200
peterz@infradead.org wrote:
> On Fri, Aug 21, 2020 at 05:03:34PM -0400, Steven Rostedt wrote:
>
> > > Sigh. Is it too hard to make mutex_trylock() usable from interrupt
> > > context?
> >
> >
> > That's a question for Thomas and Peter Z.
>
> You should really know that too, the TL;DR answer is it's fundamentally
> buggered, can't work.
I knew there was an issue but I couldn't remember the reasoning, and
figured you could easily answer it without having to look back at the
code.
>
> The problem is that RT relies on being able to PI boost the mutex owner.
>
> ISTR we had a thread about all this last year or so, let me see if I can
> find that.
>
> Here goes:
>
> https://lkml.kernel.org/r/20191218135047.GS2844@hirez.programming.kicks-ass.net
From this email:
> The problem happens when that owner is the idle task, this can happen
> when the irq/softirq hits the idle task, in that case the contending
> mutex_lock() will try and PI boost the idle task, and that is a big
> no-no.
What's wrong with priority boosting the idle task? It's not obvious,
and I can't find comments in the code saying it would be bad.
I looked around the code to see if I could find "why this is bad" but
couldn't find it. There's lots of places that say "Do not use
mutex_trylock in interrupt context, the implementation is not safe to
do so" but I can't find where it says "why" it is not safe to do so.
The idle task is not mentioned at all in rtmutex.c and not mentioned in
kernel/locking except for some comments about RCU in lockdep.
I see that in the idle code the prio_change method does a BUG(), but
there's no comment to say why it does so.
The commit that added that BUG, doesn't explain why it can't happen:
a8941d7ec8167 ("sched: Simplify the idle scheduling class")
I may have once known the rationale behind all this, but it's been a
long time since I worked on the PI code, and it's out of my cache.
-- Steve
next prev parent reply other threads:[~2020-08-22 23:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-28 11:41 Joerg Vehlow
2020-05-28 12:46 ` Steven Rostedt
2020-07-22 4:30 ` Joerg Vehlow
2020-07-22 20:51 ` Steven Rostedt
2020-07-27 23:36 ` Andrew Morton
2020-08-21 10:25 ` Joerg Vehlow
2020-08-21 15:08 ` Steven Rostedt
2020-08-21 20:47 ` Andrew Morton
2020-08-21 21:03 ` Steven Rostedt
2020-08-22 12:32 ` peterz
2020-08-22 23:49 ` Steven Rostedt [this message]
2020-09-07 11:41 ` peterz
2020-09-07 12:49 ` Valentin Schneider
2020-09-14 19:00 ` Steven Rostedt
2020-09-07 10:51 ` Joerg Vehlow
2020-09-07 11:46 ` peterz
2020-09-07 12:03 ` Joerg Vehlow
2020-09-07 16:23 ` peterz
2020-09-08 5:48 ` Joerg Vehlow
2020-09-09 5:46 ` Joerg Vehlow
2020-09-11 22:48 ` Eric W. Biederman
2020-09-14 6:03 ` Joerg Vehlow
2020-09-14 16:46 ` Eric W. Biederman
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=20200822194928.54ee4cb5@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=dave@stgolabs.net \
--cc=joerg.vehlow@aox-tech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@jv-coder.de \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=ying.huang@intel.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
Powered by JetHome