1C MP+onceassign+derefonce
2
3(*
4 * Result: Never
5 *
6 * This litmus test demonstrates that rcu_assign_pointer() and
7 * rcu_dereference() suffice to ensure that an RCU reader will not see
8 * pre-initialization garbage when it traverses an RCU-protected data
9 * structure containing a newly inserted element.
10 *)
11
12{
13y=z;
14z=0;
15}
16
17P0(int *x, int **y)
18{
19	WRITE_ONCE(*x, 1);
20	rcu_assign_pointer(*y, x);
21}
22
23P1(int *x, int **y)
24{
25	int *r0;
26	int r1;
27
28	rcu_read_lock();
29	r0 = rcu_dereference(*y);
30	r1 = READ_ONCE(*r0);
31	rcu_read_unlock();
32}
33
34exists (1:r0=x /\ 1:r1=0)
35