public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Petr Mladek <pmladek@suse.cz>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, jkosina@suse.cz,
	paulmck@linux.vnet.ibm.com, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC][PATCH] printk: Fixup the nmi printk mess
Date: Wed, 10 Jun 2015 17:32:53 +0200	[thread overview]
Message-ID: <20150610153253.GJ3644@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20150610145737.GE9409@pathway.suse.cz>


You are aware that you can delete bits of the email that are not
relevant, right?

On Wed, Jun 10, 2015 at 04:57:37PM +0200, Petr Mladek wrote:

> Also note that show_regs() calls many separate printk()s, the irqwork
> is scheduled by the first one => it is quite likely that some
> backtrace will get messed.

The irq_work is only ever called when we're inside an NMI, the irq_work
will only ever execute once that NMI is done -- on that CPU.

How will that miss anything?

> Anothrer problem is that __printk_nmi_flush() is per-CPU => more
> instances might be running in parallel. I haven't tested this but
> I quess that it will mix backtraces from different CPUs in
> the main ring buffer.

Correct, such is the life of printk().

> Note that the backtraces used to be serialized via
> static arch_spinlock_t lock = __ARCH_SPIN_LOCK_UNLOCKED
> in the past. See the commit
> a9edc8809328 ("x86/nmi: Perform a safe NMI stack trace on all CPUs")

We could easily add a static raw_spinlock_t to __printk_nmi_flush() and
serialize its invocations if people think that is important.

  reply	other threads:[~2015-06-10 15:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 12:55 [RFC][PATCH] printk: Fixup the nmi printk mess Peter Zijlstra
2015-06-10 14:31 ` Petr Mladek
2015-06-10 14:57   ` Petr Mladek
2015-06-10 15:32     ` Peter Zijlstra [this message]
2015-06-10 15:54       ` Steven Rostedt
2015-06-10 15:29   ` Peter Zijlstra
2015-06-10 19:23     ` Peter Zijlstra
2015-06-10 19:36       ` Peter Zijlstra
2015-06-10 19:36       ` Steven Rostedt
2015-06-11 14:55       ` Petr Mladek
2015-06-12 12:00         ` Peter Zijlstra
2015-06-12 14:28           ` Petr Mladek
2015-06-12 15:35             ` Petr Mladek
2015-06-25 18:14               ` Peter Zijlstra
2015-06-26  8:06                 ` Petr Mladek
2015-06-11  9:57     ` Petr Mladek
2015-06-10 15:53 ` Steven Rostedt
2015-06-10 16:02 ` Steven Rostedt
2015-06-10 16:19   ` Joe Perches
2015-06-10 19:25     ` Peter Zijlstra
2015-06-10 19:35       ` Steven Rostedt
2015-06-10 19:39       ` Joe Perches

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=20150610153253.GJ3644@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pmladek@suse.cz \
    --cc=rostedt@goodmis.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