From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Petr Mladek <pmladek@suse.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
Jiri Kosina <jkosina@suse.com>, Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"adi-buildroot-devel@lists.sourceforge.net"
<adi-buildroot-devel@lists.sourceforge.net>,
Cris <linux-cris-kernel@axis.com>,
Linux MIPS Mailing List <linux-mips@linux-mips.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
linux-s390 <linux-s390@vger.kernel.org>,
Linux-sh list <linux-sh@vger.kernel.org>,
sparclinux <sparclinux@vger.kernel.org>
Subject: Re: [PATCH v3 4/4] printk/nmi: Increase the size of NMI buffer and make it configurable
Date: Fri, 11 Dec 2015 23:21:13 +0000 [thread overview]
Message-ID: <20151211232113.GZ8644@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20151211145725.b0e81bb4bb18fcd72ef5f557@linux-foundation.org>
On Fri, Dec 11, 2015 at 02:57:25PM -0800, Andrew Morton wrote:
> This is a bit messy. NEED_PRINTK_NMI is an added-on hack for one
> particular arm variant. From the changelog:
>
> "One exception is arm where the deferred printing is used for
> printing backtraces even without NMI. For this purpose, we define
> NEED_PRINTK_NMI Kconfig flag. The alternative printk_func is
> explicitly set when IPI_CPU_BACKTRACE is handled."
>
>
> - why does arm needs deferred printing for backtraces?
>
> - why is this specific to CONFIG_CPU_V7M?
>
> - can this Kconfig logic be cleaned up a bit?
I think this comes purely from this attempt to apply another round of
cleanups to the nmi backtrace work I did.
As I explained when I did that work, the vast majority of ARM platforms
are unable to trigger anything like a NMI - the FIQ is something that's
generally a property of the secure monitor, and is not accessible to
Linux. However, there are platforms where it is accessible.
The work to add the FIQ-based variant never happened (I've no idea what
happened to that part, Daniel seems to have lost interest in working on
it.) So, what we have is the IRQ-based variant merged in mainline, which
would be the fallback for the "FIQ not available" cases, and I carry a
local hack in my tree which provides the FIQ-based version - but if it
were to trigger, it takes out all interrupts (hence why I've not merged
my hack.)
I think the reason that the FIQ-based variant has never really happened
is that hooking into the interrupt controller code to clear down the FIQ
creates such a horrid layering violation, and also a locking mess that
I suspect it's just been given up with.
However, I've found my "hack" useful - it's turned a number of totally
undebuggable hangs (where one CPU silently hangs leaving the others
running with no way to find out where the hung CPU is) into something
that can be debugged.
Now, when we end up triggering the IRQ-based variant, we could already
be in a situation where IRQs are off for the local CPU, so the IRQ is
never delivered. Others decided that it wasn't acceptable to wait 10sec
for the local CPU to time out, and (iirc) we'd also loose the local CPUs
backtrace in certain situations.
I'm personally happy with the existing code, and I've been wondering why
there's this effort to apply further cleanups - to me, the changelogs
don't seem to make that much sense, unless we want to start using
printk() extensively in NMI functions - using the generic nmi backtrace
code surely gets us something that works across all architectures...
I've been assuming that I've missed something, which is why I've not
said anything on that point until now.
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2015-12-11 23:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 13:21 [PATCH v3 0/4] Cleaning printk stuff in NMI context Petr Mladek
2015-12-09 13:21 ` [PATCH v3 1/4] printk/nmi: Generic solution for safe printk in NMI Petr Mladek
2015-12-09 23:50 ` Andrew Morton
2015-12-10 15:26 ` Petr Mladek
2015-12-09 13:21 ` [PATCH v3 2/4] printk/nmi: Use IRQ work only when ready Petr Mladek
2015-12-09 13:21 ` [PATCH v3 3/4] printk/nmi: Warn when some message has been lost in NMI context Petr Mladek
2015-12-09 13:21 ` [PATCH v3 4/4] printk/nmi: Increase the size of NMI buffer and make it configurable Petr Mladek
2015-12-11 11:10 ` Geert Uytterhoeven
2015-12-11 12:41 ` Petr Mladek
2015-12-11 12:47 ` Arnd Bergmann
2015-12-11 12:50 ` Geert Uytterhoeven
2015-12-11 22:57 ` Andrew Morton
2015-12-11 23:21 ` Russell King - ARM Linux [this message]
2015-12-11 23:30 ` Andrew Morton
2015-12-15 14:26 ` Petr Mladek
2015-12-17 22:38 ` Andrew Morton
2015-12-18 16:18 ` Petr Mladek
2015-12-14 10:28 ` Daniel Thompson
[not found] ` <alpine.LNX.2.00.1512120024370.9922@cbobk.fhfr.pm>
2015-12-18 10:18 ` Daniel Thompson
2015-12-18 11:29 ` Peter Zijlstra
2015-12-18 12:11 ` Peter Zijlstra
2015-12-18 23:03 ` Andrew Morton
2015-12-18 14:52 ` Petr Mladek
2015-12-18 17:00 ` Daniel Thompson
2016-03-01 14:04 ` Daniel Thompson
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=20151211232113.GZ8644@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=adi-buildroot-devel@lists.sourceforge.net \
--cc=akpm@linux-foundation.org \
--cc=daniel.thompson@linaro.org \
--cc=geert@linux-m68k.org \
--cc=jkosina@suse.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-cris-kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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).