]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
printk: Add per_cpu printk func to allow printk to be diverted
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Thu, 19 Jun 2014 21:33:31 +0000 (17:33 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 20 Nov 2014 03:01:21 +0000 (22:01 -0500)
commitafdc34a3d3b823a12a93b822ee1efb566f884032
treed770a2806476751adba361918edb8826762db730
parent8d58e99af5980d444948720977b0976455885391
printk: Add per_cpu printk func to allow printk to be diverted

Being able to divert printk to call another function besides the normal
logging is useful for such things like NMI handling. If some functions
are to be called from NMI that does printk() it is possible to lock up
the box if the nmi handler triggers when another printk is happening.

One example of this use is to perform a stack trace on all CPUs via NMI.
But if the NMI is to do the printk() it can cause the system to lock up.
By allowing the printk to be diverted to another function that can safely
record the printk output and then print it when it in a safe context
then NMIs will be safe to call these functions like show_regs().

Link: http://lkml.kernel.org/p/20140619213952.209176403@goodmis.org
Tested-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/linux/percpu.h
include/linux/printk.h
kernel/printk/printk.c