From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933295AbdCaOsr (ORCPT ); Fri, 31 Mar 2017 10:48:47 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35116 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933017AbdCaOsp (ORCPT ); Fri, 31 Mar 2017 10:48:45 -0400 Date: Fri, 31 Mar 2017 23:47:30 +0900 From: Sergey Senozhatsky To: Ye Xiaolong Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Petr Mladek , Jan Kara , Andrew Morton , Linus Torvalds , Peter Zijlstra , "Rafael J . Wysocki" , Eric Biederman , Greg Kroah-Hartman , Jiri Slaby , Pavel Machek , Len Brown , linux-kernel@vger.kernel.org, lkp@01.org Subject: Re: [printk] fbc14616f4: BUG:kernel_reboot-without-warning_in_test_stage Message-ID: <20170331144730.GA10578@tigerII.localdomain> References: <20170329092511.3958-9-sergey.senozhatsky@gmail.com> <20170330213829.GA21476@inn.lkp.intel.com> <20170331023506.GB3493@jagdpanzerIV.localdomain> <20170331040438.GA366@jagdpanzerIV.localdomain> <20170331063913.GE20961@yexl-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170331063913.GE20961@yexl-desktop> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (03/31/17 14:39), Ye Xiaolong wrote: > On 03/31, Sergey Senozhatsky wrote: > >On (03/31/17 11:35), Sergey Senozhatsky wrote: > >[..] > >> > [ 21.009531] VFS: Warning: trinity-c2 using old stat() call. Recompile your binary. > >> > [ 21.148898] VFS: Warning: trinity-c0 using old stat() call. Recompile your binary. > >> > [ 22.298208] warning: process `trinity-c2' used the deprecated sysctl system call with > >> > > >> > Elapsed time: 310 > >> > BUG: kernel reboot-without-warning in test stage > >> > >> so as far as I understand, this is the "missing kernel messages" > >> type of bug report. a worst case scenario. > > > >panic() should have called console_flush_on_panic(), which sould have > >flushed the messages regardless the printk_kthread state. so it probably > >was not panic() that rebooted the kernel. (probably). > > > >kernel_restart() and kernel_halt() have pr_emerg() messages, printk switches > >to printk_emergency mode the first time it sees EMERG level message. (may be > >we switch to late). > > > >on the other hand, there is a emergency_restart(), where we don't switch > >to printk_emergency mode and don't flush the existing kernel messages. > >there is a bunch of places that call emergency_restart(), including sysrq. > > > >may I ask you, how do you usually restart the vm after the test? > >`echo X > /proc/sysrq-trigger'? > > Yes. > > > > >does this patch make it any better? > > I am trying it and will post the result once I get it. ... I'd also probably add pr_emerg() print-out to emergency_restart(), the same way kernel_restart()/kernel_halt()/kernel_power_off() do. for those cases when emergency_restart() is called with printk in kthreaded mode, not in emergency mode. --- diff --git a/kernel/reboot.c b/kernel/reboot.c index e4ced883d8de..5bce29da913b 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -60,6 +60,7 @@ void (*pm_power_off_prepare)(void); */ void emergency_restart(void) { + pr_emerg("Emergency restart\n"); kmsg_dump(KMSG_DUMP_EMERG); machine_emergency_restart(); }