kernel_optimize_test/kernel/trace
Steven Rostedt 5168ae50a6 tracing: Remove ftrace_preempt_disable/enable
The ftrace_preempt_disable/enable functions were to address a
recursive race caused by the function tracer. The function tracer
traces all functions which makes it easily susceptible to recursion.
One area was preempt_enable(). This would call the scheduler and
the schedulre would call the function tracer and loop.
(So was it thought).

The ftrace_preempt_disable/enable was made to protect against recursion
inside the scheduler by storing the NEED_RESCHED flag. If it was
set before the ftrace_preempt_disable() it would not call schedule
on ftrace_preempt_enable(), thinking that if it was set before then
it would have already scheduled unless it was already in the scheduler.

This worked fine except in the case of SMP, where another task would set
the NEED_RESCHED flag for a task on another CPU, and then kick off an
IPI to trigger it. This could cause the NEED_RESCHED to be saved at
ftrace_preempt_disable() but the IPI to arrive in the the preempt
disabled section. The ftrace_preempt_enable() would not call the scheduler
because the flag was already set before entring the section.

This bug would cause a missed preemption check and cause lower latencies.

Investigating further, I found that the recusion caused by the function
tracer was not due to schedule(), but due to preempt_schedule(). Now
that preempt_schedule is completely annotated with notrace, the recusion
no longer is an issue.

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-06-03 19:32:38 -04:00
..
blktrace.c
ftrace.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
Kconfig
kmemtrace.c
Makefile
power-traces.c
ring_buffer_benchmark.c
ring_buffer.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_boot.c
trace_branch.c
trace_clock.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_entries.h
trace_event_perf.c perf, trace: Fix !x86 build bug 2010-05-25 11:28:49 +02:00
trace_events_filter.c
trace_events.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_export.c
trace_functions_graph.c
trace_functions.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_irqsoff.c
trace_kprobe.c
trace_ksym.c
trace_mmiotrace.c
trace_nop.c
trace_output.c Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-05-27 15:23:47 -07:00
trace_output.h
trace_printk.c
trace_sched_switch.c
trace_sched_wakeup.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_selftest_dynamic.c
trace_selftest.c
trace_stack.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_sysprof.c
trace_workqueue.c
trace.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace.h tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00