From: Steven Rostedt <rostedt@goodmis.org>
To: Don Zickus <dzickus@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jiri Kosina <jkosina@suse.cz>, Michal Hocko <mhocko@suse.cz>,
Jan Kara <jack@suse.cz>, Frederic Weisbecker <fweisbec@gmail.com>,
Dave Anderson <anderson@redhat.com>,
Petr Mladek <pmladek@suse.cz>
Subject: Re: [RFC][PATCH 3/3] x86/nmi: Perform a safe NMI stack trace on all CPUs
Date: Fri, 20 Jun 2014 10:21:42 -0400 [thread overview]
Message-ID: <20140620102142.223ff42f@gandalf.local.home> (raw)
In-Reply-To: <20140620135815.GG7959@redhat.com>
On Fri, 20 Jun 2014 09:58:15 -0400
Don Zickus <dzickus@redhat.com> wrote:
> On Thu, Jun 19, 2014 at 05:33:32PM -0400, Steven Rostedt wrote:
> > From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> >
> > When trigger_all_cpu_backtrace() is called on x86, it will trigger an
> > NMI on each CPU and call show_regs(). But this can lead to a hard lock
> > up if the NMI comes in on another printk().
> >
> > In order to avoid this, when the NMI triggers, it switches the printk
> > routine for that CPU to call a NMI safe printk function that records the
> > printk in a per_cpu trace_seq descriptor. After all NMIs have finished
> > recording its data, the trace_seqs are printed in a safe context.
>
> Ah, if there is other places that need to call a printk from an NMI
> context, do we have to copy and paste this code there too? That would
> seem a little much. :-) I guess my only concern really is the seq_init
> and seq print stuff. The handler seems relatively simple.
This is a special case for printing from NMI. As you can trigger it
with sysrq-l. But any other prints from NMI should only be in the BUG()
case, where we should just force the output and override any locks in
printk.
>
> Can we isolate this to a pr_nmi() routine or something? Or maybe a
> pr_nmi_queue and pr_nmi_dump or something?
>
We'll have to see how traction this gets. It's just an RFC.
-- Steve
next prev parent reply other threads:[~2014-06-20 14:21 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 21:33 [RFC][PATCH 0/3] x86/nmi: Print all cpu stacks from NMI safely Steven Rostedt
2014-06-19 21:33 ` [RFC][PATCH 1/3] trace_seq: Move the trace_seq code to lib/ Steven Rostedt
2014-06-20 4:45 ` Linus Torvalds
2014-06-20 16:21 ` Steven Rostedt
2014-06-20 5:06 ` Andrew Morton
2014-06-20 16:58 ` Steven Rostedt
2014-06-20 17:12 ` Andrew Morton
2014-06-20 17:17 ` Steven Rostedt
2014-06-20 20:28 ` Steven Rostedt
2014-06-20 20:51 ` Steven Rostedt
2014-06-23 16:33 ` Petr Mládek
2014-06-23 17:03 ` Steven Rostedt
2014-06-22 7:38 ` Johannes Berg
2014-06-23 16:08 ` Steven Rostedt
2014-06-23 17:38 ` Johannes Berg
2014-06-23 18:04 ` Steven Rostedt
2014-06-24 8:19 ` Johannes Berg
2014-06-19 21:33 ` [RFC][PATCH 2/3] printk: Add per_cpu printk func to allow printk to be diverted Steven Rostedt
2014-06-23 16:06 ` Paul E. McKenney
2014-06-19 21:33 ` [RFC][PATCH 3/3] x86/nmi: Perform a safe NMI stack trace on all CPUs Steven Rostedt
2014-06-20 13:58 ` Don Zickus
2014-06-20 14:21 ` Steven Rostedt [this message]
2014-06-20 14:55 ` Petr Mládek
2014-06-20 15:17 ` Steven Rostedt
2014-06-23 16:12 ` Paul E. McKenney
2014-06-19 21:56 ` [RFC][PATCH 0/3] x86/nmi: Print all cpu stacks from NMI safely Jiri Kosina
2014-06-19 22:58 ` Steven Rostedt
2014-06-19 23:03 ` Jiri Kosina
2014-06-19 23:19 ` Steven Rostedt
2014-06-19 23:27 ` Jiri Kosina
2014-06-19 23:36 ` Steven Rostedt
2014-06-19 23:38 ` Jiri Kosina
2014-06-20 14:35 ` Petr Mládek
2014-06-24 13:32 ` Konstantin Khlebnikov
2014-06-25 10:01 ` Jiri Kosina
2014-06-25 11:04 ` Konstantin Khlebnikov
2014-06-25 11:57 ` Petr Mládek
2014-06-25 12:21 ` Petr Mládek
2014-11-19 4:39 [RFC][PATCH 0/3] printk/seq-buf/NMI: Revisit of safe NMI printing with seq_buf code Steven Rostedt
2014-11-19 4:39 ` [RFC][PATCH 3/3] x86/nmi: Perform a safe NMI stack trace on all CPUs Steven Rostedt
2014-11-19 10:41 ` Borislav Petkov
2014-11-19 10:44 ` Jiri Kosina
2014-11-19 10:53 ` Borislav Petkov
2014-11-19 13:02 ` Petr Mladek
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=20140620102142.223ff42f@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=anderson@redhat.com \
--cc=dzickus@redhat.com \
--cc=fweisbec@gmail.com \
--cc=jack@suse.cz \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.cz \
--cc=mingo@kernel.org \
--cc=pmladek@suse.cz \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®