ftrace: printk and trace irqsoff and wakeups
authorSteven Rostedt <rostedt@goodmis.org>
Mon, 12 May 2008 19:20:54 +0000 (21:20 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 23 May 2008 19:13:02 +0000 (21:13 +0200)
commit4fe8c3048cd8280a54256bca9cac2007bd546c33
treeb6bba481a3dde79a027654675d3b34da24ca54f2
parent8f96da02c14d722ad9a3713cd7273ce28c9036ad
ftrace: printk and trace irqsoff and wakeups

printk called from wakeup critical timings and irqs off can
cause deadlocks since printk might do a wakeup itself. If the
call to printk happens with the runqueue lock held, it can
deadlock.

This patch protects the printk from being called in trace irqs off
with a test to see if the runqueue for the current CPU is locked.
If it is locked, the printk is skipped.

The wakeup always holds the runqueue lock, so the printk is
simply removed.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/trace/trace_irqsoff.c
kernel/trace/trace_sched_wakeup.c