Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752806AbbLROwP (ORCPT ); Fri, 18 Dec 2015 09:52:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:34621 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbbLROwM (ORCPT ); Fri, 18 Dec 2015 09:52:12 -0500 Date: Fri, 18 Dec 2015 15:52:07 +0100 From: Petr Mladek To: Daniel Thompson Cc: Jiri Kosina , Russell King - ARM Linux , Andrew Morton , Geert Uytterhoeven , Peter Zijlstra , Steven Rostedt , Ingo Molnar , Thomas Gleixner , "linux-kernel@vger.kernel.org" , the arch/x86 maintainers , "linux-arm-kernel@lists.infradead.org" , "adi-buildroot-devel@lists.sourceforge.net" , Cris , Linux MIPS Mailing List , "linuxppc-dev@lists.ozlabs.org" , linux-s390 , Linux-sh list , sparclinux Subject: Re: [PATCH v3 4/4] printk/nmi: Increase the size of NMI buffer and make it configurable Message-ID: <20151218145207.GK3729@pathway.suse.cz> References: <1449667265-17525-1-git-send-email-pmladek@suse.com> <1449667265-17525-5-git-send-email-pmladek@suse.com> <20151211124159.GB3729@pathway.suse.cz> <20151211145725.b0e81bb4bb18fcd72ef5f557@linux-foundation.org> <20151211232113.GZ8644@n2100.arm.linux.org.uk> <5673DD60.7080302@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5673DD60.7080302@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2412 Lines: 65 On Fri 2015-12-18 10:18:08, Daniel Thompson wrote: > On 11/12/15 23:26, Jiri Kosina wrote: > >On Fri, 11 Dec 2015, Russell King - ARM Linux wrote: > > > >>I'm personally happy with the existing code, and I've been wondering why > >>there's this effort to apply further cleanups - to me, the changelogs > >>don't seem to make that much sense, unless we want to start using > >>printk() extensively in NMI functions - using the generic nmi backtrace > >>code surely gets us something that works across all architectures... > > > >It is already being used extensively, and not only for all-CPU backtraces. > >For starters, please consider > > > >- WARN_ON(in_nmi()) > >- BUG_ON(in_nmi()) > > Sorry to join in so late but... > > Today we risk deadlock when we try to issue these diagnostic errors > directly from NMI context. > > After this change we will still risk deadlock, because that's what > the diagnostic code is trying to tell us, *and* we delay actually > reporting the error until, and only if, the NMI handler completes. I think that NMI messages about a possible deadlock are the ones from kernel/locking/rtmutex.c kernel/irq_work.c include/linux/hardirq.h You are right that if the deadlock happens, this patch set lowers the chance to see the message. On the other hand, all the other printk's in NMI seems to be non-fatal warnings. In this case, this patch set increases the chance to see them. A compromise might be to explicitly call printk_nmi_flush() in the few fatal cases. Alternatively we could force the messages on the early_console when available. > >- anything being printed out from MCE handlers > > The MCE handlers should only call printk() when they decide to panic > and *after* busting the spinlocks. At this point deferring printk() > until it is safe is not very helpful. > > When we bust the spinlocks we should probably restore the normal > printk() function to give best chance of the failure messages making > it out. The problem is that we do not know what locks need to be busted. There are too many consoles and too many locks involved. Also busting locks open another can of worms. Best Regards, Petr -- 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/