android_kernel_samsung_msm8976/kernel/trace
Josef Bacik 8c1bf5dcfe trace: Fix epoll hang when we race with new entries
commit 4ce97dbf50245227add17c83d87dc838e7ca79d0 upstream.

Epoll on trace_pipe can sometimes hang in a weird case.  If the ring buffer is
empty when we set waiters_pending but an event shows up exactly at that moment
we can miss being woken up by the ring buffers irq work.  Since
ring_buffer_empty() is inherently racey we will sometimes think that the buffer
is not empty.  So we don't get woken up and we don't think there are any events
even though there were some ready when we added the watch, which makes us hang.
This patch fixes this by making sure that we are actually on the wait list
before we set waiters_pending, and add a memory barrier to make sure
ring_buffer_empty() is going to be correct.

Link: http://lkml.kernel.org/p/1408989581-23727-1-git-send-email-jbacik@fb.com

Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-05 14:54:07 -07:00
..
blktrace.c blktrace: fix accounting of partially completed requests 2014-05-30 21:52:11 -07:00
ftrace.c tracing: Fix graph tracer with stack tracer on other archs 2014-07-28 08:00:03 -07:00
Kconfig ring-buffer: Select IRQ_WORK 2013-05-03 19:24:17 -04:00
Makefile
power-traces.c
ring_buffer.c trace: Fix epoll hang when we race with new entries 2014-10-05 14:54:07 -07:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Fix wraparound problems in "uptime" trace clock 2014-07-31 12:53:49 -07:00
trace.h ring-buffer: Check if buffer exists before polling 2014-07-17 15:58:03 -07:00
trace_branch.c tracing: Fix the branch tracer that broke with buffer change 2013-03-15 00:35:54 -04:00
trace_clock.c tracing: Fix wraparound problems in "uptime" trace clock 2014-07-31 12:53:49 -07: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 perf/ftrace: Fix paranoid level for enabling function tracer 2013-11-29 11:11:43 -08:00
trace_events.c tracing: Fix array size mismatch in format string 2014-03-31 09:58:12 -07:00
trace_events_filter.c tracing: Change event_filter_read/write to verify i_private != NULL 2013-08-29 09:47:33 -07:00
trace_events_filter_test.h
trace_export.c tracing: Fix array size mismatch in format string 2014-03-31 09:58:12 -07:00
trace_functions.c tracing: Add function probe to trigger stack traces 2013-03-15 00:36:05 -04:00
trace_functions_graph.c tracing: Consolidate max_tr into main trace_array structure 2013-03-15 00:35:40 -04:00
trace_irqsoff.c tracing: Use flag buffer_disabled for irqsoff tracer 2013-08-14 22:59:07 -07:00
trace_kdb.c tracing: Consolidate max_tr into main trace_array structure 2013-03-15 00:35:40 -04:00
trace_kprobe.c tracing/kprobes: Fail to unregister if probe event files are in use 2013-08-29 09:47:34 -07:00
trace_mmiotrace.c tracing: Consolidate max_tr into main trace_array structure 2013-03-15 00:35:40 -04:00
trace_nop.c
trace_output.c Tracing updates for Linux 3.10 2013-04-29 13:55:38 -07:00
trace_output.h tracing: Rename trace_event_mutex to trace_event_sem 2013-03-15 13:22:10 -04:00
trace_printk.c
trace_probe.c
trace_probe.h
trace_sched_switch.c tracing: Consolidate max_tr into main trace_array structure 2013-03-15 00:35:40 -04:00
trace_sched_wakeup.c tracing: Add function-trace option to disable function tracing of latency tracers 2013-03-15 00:36:08 -04:00
trace_selftest.c tracing: Fix bad parameter passed in branch selftest 2013-05-29 16:00:03 -04:00
trace_selftest_dynamic.c
trace_stack.c Tracing updates for Linux 3.10 2013-04-29 13:55:38 -07:00
trace_stat.c tracing: Check return value of tracing_init_dentry() 2013-04-12 23:02:32 -04:00
trace_stat.h
trace_syscalls.c tracing: Fix irqs-off tag display in syscall tracing 2013-07-25 14:07:43 -07:00
trace_uprobe.c tracing/uprobes: Fail to unregister if probe event files are in use 2013-08-29 09:47:34 -07:00