Re: [PATCH v2] ring-buffer: Handle a reader taking the new head in rb_handle_head_page()

From: Steven Rostedt

Date: Thu Nov 12 2026 - 07:26:06 EST


On Wed, 11 Nov 2026 13:32:13 +0000
Vincent Donnefort <vdonnefort@xxxxxxxxxx> wrote:

> Yes, now I spent more time on it, I believe it makes sense. I looked at what we
> could do and I'm trying to use a temporary RB_PAGE_HEAD | RB_PAGE_UPDATE. This
> link flag is then only converted to RB_PAGE_HEAD by the outer writer. I believe
> this would fix the race entirely... However that means the reader spins as long
> as the buffer writing is interrupted, which I admit is far from ideal.

But it is only interrupted by interrupts ;-) which should be fast.

No different than waiting for a spin lock whose owner got interrupted
by an interrupt.

-- Steve