linux/kernel/trace
Steven Rostedt (Red Hat) 24607f114f ring-buffer: Fix infinite spin in reading buffer
Commit 651e22f270 "ring-buffer: Always reset iterator to reader page"
fixed one bug but in the process caused another one. The reset is to
update the header page, but that fix also changed the way the cached
reads were updated. The cache reads are used to test if an iterator
needs to be updated or not.

A ring buffer iterator, when created, disables writes to the ring buffer
but does not stop other readers or consuming reads from happening.
Although all readers are synchronized via a lock, they are only
synchronized when in the ring buffer functions. Those functions may
be called by any number of readers. The iterator continues down when
its not interrupted by a consuming reader. If a consuming read
occurs, the iterator starts from the beginning of the buffer.

The way the iterator sees that a consuming read has happened since
its last read is by checking the reader "cache". The cache holds the
last counts of the read and the reader page itself.

Commit 651e22f270 changed what was saved by the cache_read when
the rb_iter_reset() occurred, making the iterator never match the cache.
Then if the iterator calls rb_iter_reset(), it will go into an
infinite loop by checking if the cache doesn't match, doing the reset
and retrying, just to see that the cache still doesn't match! Which
should never happen as the reset is suppose to set the cache to the
current value and there's locks that keep a consuming reader from
having access to the data.

Fixes: 651e22f270 "ring-buffer: Always reset iterator to reader page"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2014-10-02 16:51:18 -04:00
..
blktrace.c
ftrace.c ftrace: Use current addr when converting to nop in __ftrace_replace_code() 2014-08-22 21:04:35 -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
ring_buffer_benchmark.c
ring_buffer.c ring-buffer: Fix infinite spin in reading buffer 2014-10-02 16:51:18 -04:00
rpm-traces.c
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c tracing: Fix wraparound problems in "uptime" trace clock 2014-07-21 09:56:12 -04:00
trace_entries.h
trace_event_perf.c perf: Check permission only for parent tracepoint event 2014-07-28 10:01:38 +02:00
trace_events_filter_test.h
trace_events_filter.c tracing: Kill "filter_string" arg of replace_preds() 2014-07-16 14:58:53 -04:00
trace_events_trigger.c
trace_events.c Oleg Nesterov did several clean ups with the tracing filter code. 2014-08-04 12:02:48 -07:00
trace_export.c
trace_functions_graph.c tracing: Convert local function_graph functions to static 2014-07-18 21:16:06 -04:00
trace_functions.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c
trace_mmiotrace.c
trace_nop.c
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
trace_probe.c
trace_probe.h
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest_dynamic.c
trace_selftest.c
trace_seq.c tracing: Remove trace_seq_reserve() 2014-07-01 07:13:37 -04:00
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_uprobe.c tracing/uprobes: Kill the dead TRACE_EVENT_FL_USE_CALL_FILTER logic 2014-07-16 14:25:19 -04:00
trace.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-08-05 17:46:42 -07:00
trace.h tracing: let user specify tracing_thresh after selecting function_graph 2014-07-18 15:48:52 -04:00