Re: [PATCH 2/2] ring-buffer: Fix a race between readers and resize checks

2024-06-10 Thread Steven Rostedt
On Fri, 7 Jun 2024 10:29:03 +0200 Petr Pavlu wrote: > Another option could be to try traversing the whole list in smaller > parts and give up the reader_lock in between them. This would need some > care to make sure that the operation completes, e.g. the code would need > to bail out if it detect

Re: [PATCH 2/2] ring-buffer: Fix a race between readers and resize checks

2024-06-07 Thread Petr Pavlu
On 5/28/24 01:43, Steven Rostedt wrote: > On Mon, 27 May 2024 11:36:55 +0200 > Petr Pavlu wrote: > static void rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer) { @@ -2200,8 +2205,13 @@ int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size,

Re: [PATCH 2/2] ring-buffer: Fix a race between readers and resize checks

2024-05-27 Thread Steven Rostedt
On Mon, 27 May 2024 11:36:55 +0200 Petr Pavlu wrote: > >> static void rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer) > >> { > >> @@ -2200,8 +2205,13 @@ int ring_buffer_resize(struct trace_buffer *buffer, > >> unsigned long size, > >> */ > >>synchronize_rcu(); >

Re: [PATCH 2/2] ring-buffer: Fix a race between readers and resize checks

2024-05-27 Thread Petr Pavlu
On 5/20/24 15:50, Steven Rostedt wrote: > On Fri, 17 May 2024 15:40:08 +0200 > Petr Pavlu wrote: > >> The reader code in rb_get_reader_page() swaps a new reader page into the >> ring buffer by doing cmpxchg on old->list.prev->next to point it to the >> new page. Following that, if the operation i

Re: [PATCH 2/2] ring-buffer: Fix a race between readers and resize checks

2024-05-20 Thread Steven Rostedt
On Fri, 17 May 2024 15:40:08 +0200 Petr Pavlu wrote: > The reader code in rb_get_reader_page() swaps a new reader page into the > ring buffer by doing cmpxchg on old->list.prev->next to point it to the > new page. Following that, if the operation is successful, > old->list.next->prev gets updated

[PATCH 2/2] ring-buffer: Fix a race between readers and resize checks

2024-05-17 Thread Petr Pavlu
The reader code in rb_get_reader_page() swaps a new reader page into the ring buffer by doing cmpxchg on old->list.prev->next to point it to the new page. Following that, if the operation is successful, old->list.next->prev gets updated too. This means the underlying doubly-linked list is temporari