]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus
Merge tag 'drm-next-2020-04-03-1' of git://anongit.freedesktop.org/drm/drm
[mirror_ubuntu-hirsute-kernel.git] / tools / memory-model / litmus-tests / MP+fencewmbonceonce+fencermbonceonce.litmus
CommitLineData
71b7ff5e 1C MP+fencewmbonceonce+fencermbonceonce
1c27b644 2
8f32543b
PM
3(*
4 * Result: Never
5 *
6 * This litmus test demonstrates that smp_wmb() and smp_rmb() provide
7 * sufficient ordering for the message-passing pattern. However, it
8 * is usually better to use smp_store_release() and smp_load_acquire().
9 *)
10
1c27b644
PM
11{}
12
13P0(int *x, int *y)
14{
15 WRITE_ONCE(*x, 1);
16 smp_wmb();
17 WRITE_ONCE(*y, 1);
18}
19
20P1(int *x, int *y)
21{
22 int r0;
23 int r1;
24
25 r0 = READ_ONCE(*y);
26 smp_rmb();
27 r1 = READ_ONCE(*x);
28}
29
30exists (1:r0=1 /\ 1:r1=0)