From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752736AbdJPOPv (ORCPT ); Mon, 16 Oct 2017 10:15:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:44872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752151AbdJPOPu (ORCPT ); Mon, 16 Oct 2017 10:15:50 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F055521868 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Mon, 16 Oct 2017 10:15:47 -0400 From: Steven Rostedt To: Sergey Senozhatsky Cc: Petr Mladek , Linus Torvalds , LKML , Peter Zijlstra , Andrew Morton , Thomas Gleixner , Ingo Molnar Subject: Re: NMI watchdog dump does not print on hard lockup Message-ID: <20171016101547.27b4aa11@gandalf.local.home> In-Reply-To: <20171016131305.GE6316@tigerII.localdomain> References: <20171012121658.187c5af6@gandalf.local.home> <20171013111444.GB2795@pathway.suse.cz> <20171013091857.4afe8a7a@gandalf.local.home> <20171016111239.GK2795@pathway.suse.cz> <20171016131305.GE6316@tigerII.localdomain> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Oct 2017 22:13:05 +0900 Sergey Senozhatsky wrote: > just "brainstorming" it... with some silly ideas. > > pushing the data from NMI panic might look like we are replacing one > deadlock scenario with another deadlock scenario. some of the console > drivers are soooo complex internally. so I have been thinking about... > may be we can extend struct console and add ->write_on_panic() and that > handler must be as lockless as possible; so lockless that calling it > from anything that is not panic() is a severe bug. This may not be a bad idea. And make it so it can't be called unless we are in panic mode (or at least "oops in progress"). If oops_in_progress is set, and the console has a "write_on_panic" handler, then just call that. Heck, if it doesn't have one, and early_printk is defined, then perhaps that should be the default "write_on_panic" output? -- Steve > > an absolutely trivial case, > if serial console does > > console_write_cb(struct console *co, const char *s, unsigned int count) > { > spin_lock_irqsave(&port->lock, flags); > uart_console_write(s, count, console_putchar); > spin_unlock_irqrestore(&port->lock, flags); > } > > then panic callback can look like > > console_write_on_panic_cb(struct console *co, const char *s, unsigned int count) > { > /* no, we don't take the port lock here */ > uart_console_write(s, count, console_putchar); > } > > a less trivial case might look more involved. but in general that > write_on_panic() callback must do the absolute minimum of work. so > it's sort of a early console, but as part of normal console driver. > > I also got some other serial console crazy ideas, but they are not > related to this topic. > > -ss