Re: XDP socket rings, and LKMM litmus tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2 Mar 2021 at 21:04, Paul E. McKenney <paulmck@xxxxxxxxxx> 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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux