Messages in this thread | | | Date | Wed, 10 Jun 2015 17:32:53 +0200 | From | Peter Zijlstra <> | Subject | Re: [RFC][PATCH] printk: Fixup the nmi printk mess |
| |
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.
| |