Re: [PATCH v2] ring-buffer: Simplify reservation with try_cmpxchg() loop

From: Steven Rostedt
Date: Mon Feb 19 2024 - 18:02:16 EST


On Mon, 19 Feb 2024 17:30:03 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> - /*C*/ write = local_add_return(info->length, &tail_page->write);
> + /*C*/ if (!local_try_cmpxchg(&tail_page->write, &w, w + info->length)) {
> + if (info.add_timestamp & (RB_ADD_STAMP_FORCE | RB_ADD_STAMP_EXTEND))
> + info.length -= RB_LEN_TIME_EXTEND;
> + goto again;
> + }

Bah, I had my ktest config testing a different tree and this wasn't what I
was testing :-p

The above needs to be:

if (info->add_timestamp & (RB_ADD_STAMP_FORCE | RB_ADD_STAMP_EXTEND))
info->length -= RB_LEN_TIME_EXTEND;

Will send out a v3.

-- Steve