Re: [PATCH] ring-buffer: Race when writing and swapping cpu buffer in parallel

2014-06-27 Thread Petr Mládek
On Thu 2014-06-26 20:55:00, Steven Rostedt wrote: > On Thu, 26 Jun 2014 09:58:31 -0400 > Steven Rostedt wrote: > > > What we can do is force ring_buffer_swap_cpu() to only work for the CPU > > that it is on. As we have snapshot in per_cpu buffers, to make that > > work, we will need to change the

Re: [PATCH] ring-buffer: Race when writing and swapping cpu buffer in parallel

2014-06-26 Thread Steven Rostedt
On Thu, 26 Jun 2014 09:58:31 -0400 Steven Rostedt wrote: > What we can do is force ring_buffer_swap_cpu() to only work for the CPU > that it is on. As we have snapshot in per_cpu buffers, to make that > work, we will need to change the per_cpu version of snapshot to do a > smp_call_function_singl

Re: [PATCH] ring-buffer: Race when writing and swapping cpu buffer in parallel

2014-06-26 Thread Steven Rostedt
On Thu, 26 Jun 2014 15:22:38 +0200 Petr Mladek wrote: > The trace/ring_buffer allows to swap the entire ring buffer. Everything has to > be done lockless. I think that I have found a race when trying to understand > the code. The problematic situation is the following: > > CPU 1 (write/reserve e

[PATCH] ring-buffer: Race when writing and swapping cpu buffer in parallel

2014-06-26 Thread Petr Mladek
The trace/ring_buffer allows to swap the entire ring buffer. Everything has to be done lockless. I think that I have found a race when trying to understand the code. The problematic situation is the following: CPU 1 (write/reserve event) CPU 2 (swap the cpu buffer)