linux/kernel/trace
Steven Rostedt 478142c39c tracing: do not grab lock in wakeup latency function tracing
The wakeup tracer, when enabled, has its own function tracer.
It only traces the functions on the CPU where the task it is following
is on. If a task is woken on one CPU but then migrates to another CPU
before it wakes up, the latency tracer will then start tracing functions
on the other CPU.

To find which CPU the task is on, the wakeup function tracer performs
a task_cpu(wakeup_task). But to make sure the task does not disappear
it grabs the wakeup_lock, which is also taken when the task wakes up.
By taking this lock, the function tracer does not need to worry about
the task being freed as it checks its cpu.

Jan Blunck found a problem with this approach on his 32 CPU box. When
a task is being traced by the wakeup tracer, all functions take this
lock. That means that on all 32 CPUs, each function call is taking
this one lock to see if the task is on that CPU. This lock has just
serialized all functions on all 32 CPUs. Needless to say, this caused
major issues on that box. It would even lockup.

This patch changes the wakeup latency to insert a probe on the migrate task
tracepoint. When a task changes its CPU that it will run on, the
probe will take note. Now the wakeup function tracer no longer needs
to take the lock. It only compares the current CPU with a variable that
holds the current CPU the task is on. We don't worry about races since
it is OK to add or miss a function trace.

Reported-by: Jan Blunck <jblunck@suse.de>
Tested-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-09-09 23:54:04 -04:00
..
blktrace.c Merge commit 'v2.6.31-rc9' into tracing/core 2009-09-06 06:11:42 +02:00
ftrace.c Merge commit 'v2.6.31-rc9' into tracing/core 2009-09-06 06:11:42 +02:00
Kconfig ring-buffer: only enable ring_buffer_swap_cpu when needed 2009-09-04 19:42:22 -04:00
kmemtrace.c tracing: remove users of tracing_reset 2009-09-04 12:12:39 -04:00
Makefile tracing/events: convert block trace points to TRACE_EVENT() 2009-06-09 12:34:23 -04:00
ring_buffer_benchmark.c ring-buffer: have benchmark test print to trace buffer 2009-06-17 17:01:09 -04:00
ring_buffer.c ring-buffer: consolidate interface of rb_buffer_peek() 2009-09-09 23:54:02 -04:00
trace_boot.c tracing: pass around ring buffer instead of tracer 2009-09-04 18:59:39 -04:00
trace_branch.c Merge branch 'linus' into tracing/core 2009-05-07 11:17:34 +02:00
trace_clock.c tracing: fix four sparse warnings 2009-03-22 18:16:54 +01:00
trace_event_profile.c ftrace: Fix perf-tracepoint OOPS 2009-08-06 06:26:09 +02:00
trace_event_types.h trace_export: Repair missed fields 2009-06-26 20:48:40 +02:00
trace_events_filter.c tracing/filters: Defer pred allocation, fix memory leak 2009-09-04 23:22:33 +02:00
trace_events.c tracing: pass around ring buffer instead of tracer 2009-09-04 18:59:39 -04:00
trace_export.c tracing/filters: Defer pred allocation 2009-08-31 10:58:08 +02:00
trace_functions_graph.c tracing: pass around ring buffer instead of tracer 2009-09-04 18:59:39 -04:00
trace_functions.c Merge branch 'linus' into tracing/core 2009-07-18 12:20:01 +02:00
trace_hw_branches.c Merge branch 'tracing/hw-branch-tracing' into tracing/core 2009-05-07 13:36:22 +02:00
trace_irqsoff.c tracing: use timestamp to determine start of latency traces 2009-09-04 18:44:22 -04:00
trace_mmiotrace.c tracing: pass around ring buffer instead of tracer 2009-09-04 18:59:39 -04:00
trace_nop.c tracing/ftrace: make nop-tracer use polling wait for events on pipe 2009-03-23 09:22:15 +01:00
trace_output.c tracing: Fix trace_print_seq() 2009-07-02 08:51:13 +02:00
trace_output.h tracing: add protection around module events unload 2009-06-09 17:29:07 -04:00
trace_power.c tracing: pass around ring buffer instead of tracer 2009-09-04 18:59:39 -04:00
trace_printk.c tracing: show proper address for trace-printk format 2009-07-23 10:07:17 -04:00
trace_sched_switch.c tracing: pass around ring buffer instead of tracer 2009-09-04 18:59:39 -04:00
trace_sched_wakeup.c tracing: do not grab lock in wakeup latency function tracing 2009-09-09 23:54:04 -04:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_selftest.c tracing/function-graph-tracer: Move graph event insertion helpers in the graph tracer file 2009-08-06 07:28:06 +02:00
trace_stack.c trace_stack: Simplify seqfile code 2009-08-17 11:25:09 +02:00
trace_stat.c trace_stat: Fix missing entry in stat file 2009-08-17 11:25:09 +02:00
trace_stat.h tracing/stat: Add stat_release() callback 2009-07-10 12:14:05 +02:00
trace_syscalls.c tracing: pass around ring buffer instead of tracer 2009-09-04 18:59:39 -04:00
trace_sysprof.c Merge branch 'timers-for-linus-migration' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-06-15 10:06:19 -07:00
trace_workqueue.c tracing/workqueues: Add refcnt to struct cpu_workqueue_stats 2009-07-10 12:14:07 +02:00
trace.c Merge commit 'v2.6.31-rc9' into tracing/core 2009-09-06 06:11:42 +02:00
trace.h tracing: add trace_array_printk for internal tracers to use 2009-09-04 19:13:53 -04:00