Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965048AbbFJPdJ (ORCPT ); Wed, 10 Jun 2015 11:33:09 -0400 Received: from casper.infradead.org ([85.118.1.10]:60454 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbbFJPc5 (ORCPT ); Wed, 10 Jun 2015 11:32:57 -0400 Date: Wed, 10 Jun 2015 17:32:53 +0200 From: Peter Zijlstra To: Petr Mladek Cc: Steven Rostedt , linux-kernel@vger.kernel.org, jkosina@suse.cz, paulmck@linux.vnet.ibm.com, Ingo Molnar , Thomas Gleixner Subject: Re: [RFC][PATCH] printk: Fixup the nmi printk mess Message-ID: <20150610153253.GJ3644@twins.programming.kicks-ass.net> References: <20150610125509.GO19282@twins.programming.kicks-ass.net> <20150610143155.GD9409@pathway.suse.cz> <20150610145737.GE9409@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150610145737.GE9409@pathway.suse.cz> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1328 Lines: 34 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/