C lock-write2 (* Expected result: allowed *) { } P0(int *x, int *y, spinlock_t *s) { int r0; WRITE_ONCE(*x, 1); smp_wmb(); spin_lock(s); r0 = READ_ONCE(*y); spin_unlock(s); } P1(int *x, int *y) { int r1; WRITE_ONCE(*y, 1); smp_mb(); r1 = READ_ONCE(*x); } Observed 1:r1=0; 0:r0=0;