aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_sched_wakeup.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-05-12 15:20:54 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 15:13:02 -0400
commit4fe8c3048cd8280a54256bca9cac2007bd546c33 (patch)
treeb6bba481a3dde79a027654675d3b34da24ca54f2 /kernel/trace/trace_sched_wakeup.c
parent8f96da02c14d722ad9a3713cd7273ce28c9036ad (diff)
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>
Diffstat (limited to 'kernel/trace/trace_sched_wakeup.c')
-rw-r--r--kernel/trace/trace_sched_wakeup.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index 2a012423f9d0..5948011006bc 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -106,19 +106,6 @@ wakeup_sched_switch(struct task_struct *prev, struct task_struct *next)
106 106
107 update_max_tr(tr, wakeup_task, wakeup_cpu); 107 update_max_tr(tr, wakeup_task, wakeup_cpu);
108 108
109 if (tracing_thresh) {
110 printk(KERN_INFO "(%16s-%-5d|#%d):"
111 " %lu us wakeup latency violates %lu us threshold.\n",
112 wakeup_task->comm, wakeup_task->pid,
113 raw_smp_processor_id(),
114 latency, nsecs_to_usecs(tracing_thresh));
115 } else {
116 printk(KERN_INFO "(%16s-%-5d|#%d):"
117 " new %lu us maximum wakeup latency.\n",
118 wakeup_task->comm, wakeup_task->pid,
119 cpu, latency);
120 }
121
122out_unlock: 109out_unlock:
123 __wakeup_reset(tr); 110 __wakeup_reset(tr);
124 spin_unlock_irqrestore(&wakeup_lock, flags); 111 spin_unlock_irqrestore(&wakeup_lock, flags);