linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Petr Mladek <pmladek@suse.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Kees Cook <keescook@chromium.org>, Borislav Petkov <bp@suse.de>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andi Kleen <ak@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH v5] panic: Avoid the extra noise dmesg
Date: Fri, 1 Mar 2019 12:11:31 +0800	[thread overview]
Message-ID: <20190301041131.ypg6oaxhzyrgkkfu@shbuild888> (raw)
In-Reply-To: <20190228120014.19c0ab9227809341c1d5acc6@linux-foundation.org>

Hi Andrew,

Thanks for the review!

On Thu, Feb 28, 2019 at 12:00:14PM -0800, Andrew Morton wrote:
> On Fri, 22 Feb 2019 14:09:59 +0800 Feng Tang <feng.tang@intel.com> wrote:
> 
> > When kernel panic happens, it will first print the panic call stack,
> > then the ending msg like:
> > 
> > [   35.743249] ---[ end Kernel panic - not syncing: Fatal exception
> > [   35.749975] ------------[ cut here ]------------
> > 
> > The above message are very useful for debugging.
> > 
> > But if system is configured to not reboot on panic, say the "panic_timeout"
> > parameter equals 0, it will likely print out many noisy message like
> > WARN() call stack for each and every CPU except the panic one, messages
> > like below:
> > 
> > 	WARNING: CPU: 1 PID: 280 at kernel/sched/core.c:1198 set_task_cpu+0x183/0x190
> > 	Call Trace:
> > 	<IRQ>
> > 	try_to_wake_up
> > 	default_wake_function
> > 	autoremove_wake_function
> > 	__wake_up_common
> > 	__wake_up_common_lock
> > 	__wake_up
> > 	wake_up_klogd_work_func
> > 	irq_work_run_list
> > 	irq_work_tick
> > 	update_process_times
> > 	tick_sched_timer
> > 	__hrtimer_run_queues
> > 	hrtimer_interrupt
> > 	smp_apic_timer_interrupt
> > 	apic_timer_interrupt
> 
> It's a fairly ugly-looking patch but I am inclined to agree.

Yes, it's ugly :) we've changed 3 methods to tackle this.

> The panicing CPU is spinning and blinking a LED and all CPUs have
> interrupts enabled and the system is known to be in a messed up state. 
> All sorts of kernel code could emit all sorts of output in such
> circumstances.  So a global printk-killing knob seems appropriate.
> 
> Thoughts:
> 
> - why do the suppression in vprintk_emit()?  Doing it right at entry
>   to printk() seems cleaner, more explicit?

Yes, I put it in printk() in one earlier post, and Petr suggested to
put it into vprintk_emit so that it works for all printk() interfaces,
like the devkmsg_write -> printk_emit -> vprintk_emit path.

> 
> - Other code sites may wish to suppress all printks.  Perhaps
>   `panic_suppress_printk' should just be called `suppress_printk'?
Ok, then I'll move the definition from panic.c to printk code.

Thanks,
Feng


  reply	other threads:[~2019-03-01  4:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  6:00 [PATCH v5] panic: Avoid the extra noise dmesg Feng Tang
2019-02-22  6:09 ` Feng Tang
2019-02-28 20:00   ` Andrew Morton
2019-03-01  4:11     ` Feng Tang [this message]
2019-03-01  8:54       ` Petr Mladek
2019-03-01 19:29         ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190301041131.ypg6oaxhzyrgkkfu@shbuild888 \
    --to=feng.tang@intel.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sashal@kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).