1
0
Fork 0
alistair23-linux/drivers/tty
Feng Tang c39ea0b9dd panic: avoid the extra noise dmesg
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

For people working in console mode, the screen will first show the panic
call stack, but immediately overridden by these noisy extra messages,
which makes debugging much more difficult, as the original context gets
lost on screen.

Also these noisy messages will confuse some users, as I have seen many bug
reporters posted the noisy message into bugzilla, instead of the real
panic call stack and context.

Adding a flag "suppress_printk" which gets set in panic() to avoid those
noisy messages, without changing current kernel behavior that both panic
blinking and sysrq magic key can work as is, suggested by Petr Mladek.

To verify this, make sure kernel is not configured to reboot on panic and
in console
 # echo c > /proc/sysrq-trigger
to see if console only prints out the panic call stack.

Link: http://lkml.kernel.org/r/1551430186-24169-1-git-send-email-feng.tang@intel.com
Signed-off-by: Feng Tang <feng.tang@intel.com>
Suggested-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-05-14 19:52:51 -07:00
..
hvc tty: remove redundant 'default n' from Kconfig-s 2019-04-16 15:21:33 +02:00
ipwireless tty: add SPDX identifiers to Kconfig and Makefiles 2019-04-04 18:48:43 +02:00
serdev tty: add SPDX identifiers to Kconfig and Makefiles 2019-04-04 18:48:43 +02:00
serial dmaengine updates for v5.2-rc1 2019-05-09 08:51:45 -07:00
vt TTY/Serial patches for 5.2-rc1 2019-05-08 10:07:28 -07:00
Kconfig docs: serial: convert docs to ReST and rename to *.rst 2019-04-25 11:37:42 +02:00
Makefile tty: Add NULL TTY driver 2019-04-16 15:21:34 +02:00
amiserial.c kill TIOCSERGSTRUCT 2018-10-13 00:50:53 -04:00
cyclades.c cyclades: switch to ->[sg]et_serial() 2018-10-13 00:50:30 -04:00
ehv_bytechan.c tty: Convert to using %pOFn instead of device_node.name 2018-09-18 16:07:25 +02:00
goldfish.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
isicom.c isicom: switch to ->[sg]et_serial() 2018-10-13 00:50:31 -04:00
mips_ejtag_fdc.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
moxa.c moxa: switch to ->[sg]et_serial() 2018-10-13 00:50:32 -04:00
moxa.h tty: moxa: Add support for CMSPAR 2017-11-28 15:32:33 +01:00
mxser.c mxser: switch to ->[sg]et_serial() 2018-10-13 00:50:32 -04:00
mxser.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
n_gsm.c tty: n_gsm: Mark expected switch fall-throughs 2019-02-26 12:30:44 +01:00
n_hdlc.c tty/n_hdlc: mark expected switch fall-through 2019-02-14 10:49:19 +01:00
n_null.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_r3964.c tty: Don't block on IO when ldisc change is pending 2018-12-05 12:16:33 +01:00
n_tracerouter.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_tracesink.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_tracesink.h tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_tty.c n_tty: check for negative and zero space return from tty_write_room 2019-04-16 15:21:33 +02:00
nozomi.c tty/nozomi: use pci_iomap instead of ioremap_nocache 2019-02-12 10:26:45 +01:00
pty.c Revert "tty: pty: Fix race condition between release_one_tty and pty_write" 2019-03-29 15:47:40 +01:00
rocket.c TTY/Serial patches for 5.2-rc1 2019-05-08 10:07:28 -07:00
rocket.h tty: rocket: Remove RCPK_GET_STRUCT ioctl 2019-04-25 11:58:56 +02:00
rocket_int.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
synclink.c tty/synclink: remove ISA support 2019-02-12 08:51:33 +01:00
synclink_gt.c synclink_gt(): fix compat_ioctl() 2018-10-13 00:50:52 -04:00
synclinkmp.c synclink: reduce pointless checks in ->ioctl() 2018-10-13 00:50:43 -04:00
sysrq.c panic: avoid the extra noise dmesg 2019-05-14 19:52:51 -07:00
tty_audit.c audit: join tty records to their syscall 2019-02-07 21:33:54 -05:00
tty_baudrate.c termios, tty/tty_baudrate.c: fix buffer overrun 2018-11-08 03:36:45 -08:00
tty_buffer.c tty: increase the default flip buffer limit to 2*640K 2019-01-30 12:03:58 +01:00
tty_io.c tty: update obsolete termios comment 2019-04-25 11:58:56 +02:00
tty_ioctl.c move compat handling of tty ioctls to tty_compat_ioctl() 2018-09-14 11:12:17 -04:00
tty_jobctrl.c tty: fix read of tty->pgrp outside of ctrl_lock 2019-03-28 01:28:23 +09:00
tty_ldisc.c tty: ldisc: add sysctl to prevent autoloading of ldiscs 2019-01-30 09:31:30 +01:00
tty_ldsem.c tty/ldsem: Decrement wait_readers on timeouted down_read() 2018-12-05 12:16:33 +01:00
tty_mutex.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tty_port.c Revert "tty: fix NULL pointer issue when tty_port ops is not set" 2019-04-16 15:21:34 +02:00
ttynull.c tty: Add NULL TTY driver 2019-04-16 15:21:34 +02:00
vcc.c tty: fix up a few remaining files without SPDX identifiers 2019-04-04 18:48:43 +02:00