Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / memory-model / litmus-tests / MP+unlocklockonceonce+fencermbonceonce.litmus
blob2feb1398be7160f824bfdfb30d28a068b39f1fbd
1 C MP+unlocklockonceonce+fencermbonceonce
3 (*
4  * Result: Never
5  *
6  * If two locked critical sections execute on the same CPU, stores in the
7  * first must propagate to each CPU before stores in the second do, even if
8  * the critical sections are protected by different locks.
9  *)
13 P0(spinlock_t *s, spinlock_t *t, int *x, int *y)
15         spin_lock(s);
16         WRITE_ONCE(*x, 1);
17         spin_unlock(s);
18         spin_lock(t);
19         WRITE_ONCE(*y, 1);
20         spin_unlock(t);
23 P1(int *x, int *y)
25         int r1;
26         int r2;
28         r1 = READ_ONCE(*y);
29         smp_rmb();
30         r2 = READ_ONCE(*x);
33 exists (1:r1=1 /\ 1:r2=0)