alistair23-linux/kernel/trace
Corey Minyard 021c5b3445 ring-buffer: Always run per-cpu ring buffer resize with schedule_work_on()
The code for resizing the trace ring buffers has to run the per-cpu
resize on the CPU itself.  The code was using preempt_off() and
running the code for the current CPU directly, otherwise calling
schedule_work_on().

At least on RT this could result in the following:

|BUG: sleeping function called from invalid context at kernel/rtmutex.c:673
|in_atomic(): 1, irqs_disabled(): 0, pid: 607, name: bash
|3 locks held by bash/607:
|CPU: 0 PID: 607 Comm: bash Not tainted 3.12.15-rt25+ #124
|(rt_spin_lock+0x28/0x68)
|(free_hot_cold_page+0x84/0x3b8)
|(free_buffer_page+0x14/0x20)
|(rb_update_pages+0x280/0x338)
|(ring_buffer_resize+0x32c/0x3dc)
|(free_snapshot+0x18/0x38)
|(tracing_set_tracer+0x27c/0x2ac)

probably via
|cd /sys/kernel/debug/tracing/
|echo 1 > events/enable ; sleep 2
|echo 1024 > buffer_size_kb

If we just always use schedule_work_on(), there's no need for the
preempt_off().  So do that.

Link: http://lkml.kernel.org/p/1405537633-31518-1-git-send-email-cminyard@mvista.com

Reported-by: Stanislav Meduna <stano@meduna.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2014-07-18 13:58:12 -04:00
..
blktrace.c Most of the changes were largely clean ups, and some documentation. 2014-04-03 10:26:31 -07:00
ftrace.c tracing: Remove function_trace_stop and HAVE_FUNCTION_TRACE_MCOUNT_TEST 2014-07-18 13:58:12 -04:00
Kconfig tracing: Remove function_trace_stop and HAVE_FUNCTION_TRACE_MCOUNT_TEST 2014-07-18 13:58:12 -04:00
Makefile tracing: Move the trace_seq_* functions into its own trace_seq.c file 2014-07-01 07:13:35 -04:00
power-traces.c PM / tracing: remove deprecated power trace API 2013-01-26 00:39:12 +01:00
ring_buffer.c ring-buffer: Always run per-cpu ring buffer resize with schedule_work_on() 2014-07-18 13:58:12 -04:00
ring_buffer_benchmark.c trace: Replace hardcoding of 19 with MAX_NICE 2014-02-27 12:41:03 +01:00
rpm-traces.c PM / Runtime: Introduce trace points for tracing rpm_* functions 2011-09-27 22:53:27 +02:00
trace.c Merge branch 'trace/ftrace/urgent' into trace/ftrace/core 2014-07-09 11:02:34 -04:00
trace.h tracing: Fix check of ftrace_trace_arrays list_empty() check 2014-06-10 13:53:50 -04:00
trace_benchmark.c tracing: Only calculate stats of tracepoint benchmarks for 2^32 times 2014-06-06 00:41:38 -04:00
trace_benchmark.h tracing: Add tracepoint benchmark tracepoint 2014-05-29 22:49:54 -04:00
trace_branch.c tracing: Update event filters for multibuffer 2013-11-05 16:50:20 -05:00
trace_clock.c tracing: Add "uptime" trace clock that uses jiffies 2013-03-15 00:36:09 -04:00
trace_entries.h tracing: Add trace_puts() for even faster trace_printk() tracing 2013-03-15 00:35:55 -04:00
trace_event_perf.c kprobes, ftrace: Use NOKPROBE_SYMBOL macro in ftrace 2014-04-24 10:26:39 +02:00
trace_events.c tracing: Convert pr_warning() to pr_warn() in trace_events.c 2014-07-01 07:13:42 -04:00
trace_events_filter.c tracing: Add and use generic set_trigger_filter() implementation 2013-12-21 22:02:17 -05:00
trace_events_filter_test.h tracing/filter: Add startup tests for events filter 2011-08-19 14:35:59 -04:00
trace_events_trigger.c tracing: Use rcu_dereference_sched() for trace event triggers 2014-05-02 23:12:42 -04:00
trace_export.c tracing: Fix anonymous unions in struct ftrace_event_call 2014-04-09 20:02:55 -04:00
trace_functions.c tracing: Remove mock up poll wait function 2014-04-30 08:40:05 -04:00
trace_functions_graph.c ftrace-graph: Remove usage of ftrace_stop() in ftrace_graph_stop() 2014-07-18 13:56:58 -04:00
trace_irqsoff.c tracing: Allow irq/preempt tracers to be used by instances 2014-04-21 13:59:29 -04:00
trace_kdb.c tracing: Consolidate max_tr into main trace_array structure 2013-03-15 00:35:40 -04:00
trace_kprobe.c Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-06-12 19:18:49 -07:00
trace_mmiotrace.c tracing: Update event filters for multibuffer 2013-11-05 16:50:20 -05:00
trace_nop.c tracing: Remove mock up poll wait function 2014-04-30 08:40:05 -04:00
trace_output.c tracing: Add trace_seq_buffer_ptr() helper function 2014-07-01 07:13:39 -04:00
trace_output.h tracing: Make trace_seq_putmem_hex() more robust 2014-07-01 07:13:37 -04:00
trace_printk.c tracing: Add __tracepoint_string() to export string pointers 2013-07-26 13:39:44 -04:00
trace_probe.c kprobes, ftrace: Use NOKPROBE_SYMBOL macro in ftrace 2014-04-24 10:26:39 +02:00
trace_probe.h kprobes, ftrace: Use NOKPROBE_SYMBOL macro in ftrace 2014-04-24 10:26:39 +02:00
trace_sched_switch.c tracing: Update event filters for multibuffer 2013-11-05 16:50:20 -05:00
trace_sched_wakeup.c tracing: Remove mock up poll wait function 2014-04-30 08:40:05 -04:00
trace_selftest.c tracing: Add static to local functions 2014-04-21 14:00:46 -04:00
trace_selftest_dynamic.c ftrace: Add self-tests for multiple function trace users 2011-05-18 19:24:51 -04:00
trace_seq.c tracing: Remove trace_seq_reserve() 2014-07-01 07:13:37 -04:00
trace_stack.c tracing: Print max callstack on stacktrace bug 2014-06-02 16:43:49 -04:00
trace_stat.c trace/trace_stat: use rbtree postorder iteration helper instead of opencoding 2013-11-05 16:01:47 -05:00
trace_stat.h tracing/stat: Add stat_release() callback 2009-07-10 12:14:05 +02:00
trace_syscalls.c tracing: Consolidate event trigger code 2014-01-09 21:20:07 -05:00
trace_uprobe.c tracing/uprobes: Fix the usage of uprobe_buffer_enable() in probe_event_enable() 2014-06-30 13:22:33 -04:00