Skip to content

Commit

Permalink
ftrace: debug smp_processor_id, use notrace preempt disable
Browse files Browse the repository at this point in the history
The debug smp_processor_id caused a recursive fault in debugging
the irqsoff tracer. The tracer used a smp_processor_id in the
ftrace callback, and this function called preempt_disable which
also is traced. This caused a recursive fault (stack overload).

Since using smp_processor_id without debugging on does not cause
faults with the tracer (even when the tracer is wrong), the
debug version should not cause a system reboot.

This changes the debug_smp_processor_id to use the notrace versions
of preempt_disable and enable.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Steven Rostedt authored and KAGA-KOKO committed May 23, 2008
1 parent f43fdad commit 5568b13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/smp_processor_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ notrace unsigned int debug_smp_processor_id(void)
/*
* Avoid recursion:
*/
preempt_disable();
preempt_disable_notrace();

if (!printk_ratelimit())
goto out_enable;
Expand All @@ -49,7 +49,7 @@ notrace unsigned int debug_smp_processor_id(void)
dump_stack();

out_enable:
preempt_enable_no_resched();
preempt_enable_no_resched_notrace();
out:
return this_cpu;
}
Expand Down

0 comments on commit 5568b13

Please sign in to comment.