Re: [RFC PATCH] ring-buffer: Fix and comment ring buffer rb_time functions on 32-bit

2023-12-12 Thread Steven Rostedt
On Tue, 12 Dec 2023 11:49:20 -0500 Mathieu Desnoyers wrote: > >> So the old "bottom" value is returned, which is wrong. > > > > Ah, OK that makes more sense. Yeah, if I had the three words from the > > beginning, I would have tested to make sure they all match an not just the > > two :-p >

Re: [RFC PATCH] ring-buffer: Fix and comment ring buffer rb_time functions on 32-bit

2023-12-12 Thread Mathieu Desnoyers
On 2023-12-11 23:38, Steven Rostedt wrote: On Mon, 11 Dec 2023 22:51:04 -0500 Mathieu Desnoyers wrote: [...] For this first issue, here is the race: rb_time_cmpxchg() [...] if (!rb_time_read_cmpxchg(&t->msb, msb, msb2)) return false; if (!rb_time_read_cm

Re: [RFC PATCH] ring-buffer: Fix and comment ring buffer rb_time functions on 32-bit

2023-12-11 Thread Steven Rostedt
On Mon, 11 Dec 2023 22:51:04 -0500 Mathieu Desnoyers wrote: > On 2023-12-11 17:59, Steven Rostedt wrote: > > On Mon, 11 Dec 2023 15:13:24 -0500 > > Mathieu Desnoyers wrote: > > > >> Going through a review of the ring buffer rb_time functions for 32-bit > >> architectures, I updated the commen

Re: [RFC PATCH] ring-buffer: Fix and comment ring buffer rb_time functions on 32-bit

2023-12-11 Thread Mathieu Desnoyers
On 2023-12-11 17:59, Steven Rostedt wrote: On Mon, 11 Dec 2023 15:13:24 -0500 Mathieu Desnoyers wrote: Going through a review of the ring buffer rb_time functions for 32-bit architectures, I updated the comments to match the code, and identified the following issues: Thanks Mathieu! - rb_

Re: [RFC PATCH] ring-buffer: Fix and comment ring buffer rb_time functions on 32-bit

2023-12-11 Thread Steven Rostedt
On Mon, 11 Dec 2023 17:59:04 -0500 Steven Rostedt wrote: > > > > - A cmpxchg interrupted by 4 writes or cmpxchg overflows the counter > > and produces corrupted time stamps. This is _not_ fixed by this patch. > > Except that it's not 4 bits that is compared, but 32 bits. That should be "no

Re: [RFC PATCH] ring-buffer: Fix and comment ring buffer rb_time functions on 32-bit

2023-12-11 Thread Steven Rostedt
On Mon, 11 Dec 2023 15:13:24 -0500 Mathieu Desnoyers wrote: > Going through a review of the ring buffer rb_time functions for 32-bit > architectures, I updated the comments to match the code, and identified > the following issues: Thanks Mathieu! > > - rb_time_cmpxchg() needs to update the msb

[RFC PATCH] ring-buffer: Fix and comment ring buffer rb_time functions on 32-bit

2023-12-11 Thread Mathieu Desnoyers
Going through a review of the ring buffer rb_time functions for 32-bit architectures, I updated the comments to match the code, and identified the following issues: - rb_time_cmpxchg() needs to update the msb last, so it matches the validation of top and msb by __rb_time_read(). This is fixed by