[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231218134240.4ed0ecbd@gandalf.local.home>
Date: Mon, 18 Dec 2023 13:42:40 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Mark
Rutland <mark.rutland@....com>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 1/2] ring-buffer: Replace rb_time_cmpxchg() with
rb_time_cmp_and_update()
On Mon, 18 Dec 2023 10:15:31 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> Basically I broke it into:
>
> 1. Remove workaround exposure from the main logic. (this patch)
> 2. Remove the workaround. (next patch).
>
> >
> > Isn't this part actual change?
>
> This part is abstracted out from the main logic. Which is why I made this
> patch.
>
> >
> > > static bool rb_time_cmp_and_update(rb_time_t *t, u64 expect, u64 set)
> > > {
> > > - return rb_time_cmpxchg(t, expect, set);
> > > +#ifdef RB_TIME_32
> > > + return expect == READ_ONCE(t->time);
>
> And I need to make a v2 as the above is wrong. It should have been:
>
> return expect == local64_read(&t->time);
My v2 version will also make 64 bit not guaranteed to update on return of
true. Which adds even more reason to separate out the two.
-- Steve
Powered by blists - more mailing lists