[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+HfNi1Y16ftJb-Ct3gCUvu71GW6VnEcvibvwyY9nxZMu5nfw@mail.gmail.com>
Date: Tue, 2 Mar 2021 21:37:55 +0100
From: Björn Töpel <bjorn.topel@...il.com>
To: paulmck@...nel.org
Cc: bpf <bpf@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
stern@...land.harvard.edu, parri.andrea@...il.com,
Will Deacon <will@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, boqun.feng@...il.com,
npiggin@...il.com, dhowells@...hat.com, j.alglave@....ac.uk,
luc.maranget@...ia.fr, akiyks@...il.com, dlustig@...dia.com,
joel@...lfernandes.org,
Toke Høiland-Jørgensen <toke@...hat.com>,
"Karlsson, Magnus" <magnus.karlsson@...el.com>
Subject: Re: XDP socket rings, and LKMM litmus tests
On Tue, 2 Mar 2021 at 21:04, Paul E. McKenney <paulmck@...nel.org> wrote:
>
[...]
>
> And if the answer is "yes", how about this one?
>
With the == to != change in P1, this is OK!
> P0(int *prod, int *cons, int *data)
> {
> int p;
>
> p = READ_ONCE(*prod);
> if (p == READ_ONCE(*cons)) {
...and now d==1 is not a valid state anymore according to herd. If
think I need some input here! :-D
> WRITE_ONCE(*data, 1);
> smp_wmb();
> WRITE_ONCE(*prod, p ^ 1);
> }
> }
>
> P1(int *prod, int *cons, int *data)
> {
> int c;
> int d = -1;
>
> c = READ_ONCE(*cons);
> if (READ_ONCE(*prod) == c) {
> smp_rmb();
> d = READ_ONCE(*data);
> smp_mb();
> WRITE_ONCE(*cons, c ^ 1);
> }
> }
>
[...]
Björn
Powered by blists - more mailing lists