From: Steven Rostedt <rostedt@goodmis.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI
Date: Thu, 27 Apr 2017 15:42:48 +0000 [thread overview]
Message-ID: <20170427114248.1d751efd@gandalf.local.home> (raw)
In-Reply-To: <20170427152807.GY3452@pathway.suse.cz>
On Thu, 27 Apr 2017 17:28:07 +0200
Petr Mladek <pmladek@suse.com> wrote:
> > When I get a chance, I'll see if I can insert a trigger to crash the
> > kernel from NMI on another box and see if this patch helps.
>
> I actually tested it here using this hack:
>
> diff --cc lib/nmi_backtrace.c
> index d531f85c0c9b,0bc0a3535a8a..000000000000
> --- a/lib/nmi_backtrace.c
> +++ b/lib/nmi_backtrace.c
> @@@ -89,8 -90,7 +90,9 @@@ bool nmi_cpu_backtrace(struct pt_regs *
> int cpu = smp_processor_id();
>
> if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
> + if (in_nmi())
> + panic("Simulating panic in NMI\n");
> + arch_spin_lock(&lock);
I was going to create a ftrace trigger, to crash on demand, but this
may do as well.
> if (regs && cpu_in_idle(instruction_pointer(regs))) {
> pr_warn("NMI backtrace for cpu %d skipped: idling at pc %#lx\n",
> cpu, instruction_pointer(regs));
>
> and triggered by:
>
> echo l > /proc/sysrq-trigger
>
> The patch really helped to see much more (all) messages from the ftrace
> buffers in NMI mode.
>
> But the test is a bit artifical. The patch might not help when there
> is a big printk() activity on the system when the panic() is
> triggered. We might wrongly use the small per-CPU buffer when
> the logbuf_lock is tested and taken on another CPU at the same time.
> It means that it will not always help.
>
> I personally think that the patch might be good enough. I am not sure
> if a perfect (more comlpex) solution is worth it.
I wasn't asking for perfect, as the previous solutions never were
either. I just want an optimistic dump if possible.
I'll try to get some time today to test this, and let you know. But it
wont be on the machine that I originally had the issue with.
Thanks,
-- Steve
next prev parent reply other threads:[~2017-04-27 15:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 11:48 [PATCH v5 0/4] Cleaning printk stuff in NMI context Petr Mladek
2016-04-21 11:48 ` [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI Petr Mladek
2016-04-27 9:31 ` Russell King - ARM Linux
2017-04-19 17:13 ` Steven Rostedt
2017-04-19 17:21 ` Peter Zijlstra
2017-04-20 3:31 ` Sergey Senozhatsky
2017-04-20 13:11 ` Petr Mladek
2017-04-21 1:57 ` Sergey Senozhatsky
2017-04-21 12:06 ` Petr Mladek
2017-04-24 2:17 ` Sergey Senozhatsky
2017-04-27 13:38 ` Petr Mladek
2017-04-27 14:31 ` Steven Rostedt
2017-04-27 15:28 ` Petr Mladek
2017-04-27 15:42 ` Steven Rostedt [this message]
2017-04-28 9:02 ` Peter Zijlstra
2017-04-28 13:44 ` Petr Mladek
2017-04-28 13:58 ` Peter Zijlstra
2017-04-28 14:47 ` Steven Rostedt
2017-04-27 16:14 ` Steven Rostedt
2017-04-28 1:35 ` Sergey Senozhatsky
2017-04-28 12:57 ` Petr Mladek
2017-04-28 14:16 ` Steven Rostedt
2017-04-28 1:25 ` Sergey Senozhatsky
2017-04-28 12:38 ` Petr Mladek
2016-04-21 11:48 ` [PATCH v5 2/4] printk/nmi: warn when some message has been lost in NMI context Petr Mladek
2016-04-27 9:34 ` Russell King - ARM Linux
2016-04-21 11:48 ` [PATCH v5 3/4] printk/nmi: increase the size of NMI buffer and make it configurable Petr Mladek
2016-04-21 11:48 ` [PATCH v5 4/4] printk/nmi: flush NMI messages on the system panic Petr Mladek
2016-04-23 3:49 ` Sergey Senozhatsky
2016-04-26 14:21 ` Petr Mladek
2016-04-27 0:34 ` Sergey Senozhatsky
2016-04-27 0:36 ` [PATCH v5 0/4] Cleaning printk stuff in NMI context Sergey Senozhatsky
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=20170427114248.1d751efd@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-arm-kernel@lists.infradead.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).