/
C-RW-R+RW-R+RW-G+RW-G+RW-G+RW-G+RW-R+RW-R+RW-R+RW-R+RW-G+RW-G+RW-G+RW-G+RW-R+RW-R.litmus
180 lines (148 loc) · 3.16 KB
/
C-RW-R+RW-R+RW-G+RW-G+RW-G+RW-G+RW-R+RW-R+RW-R+RW-R+RW-G+RW-G+RW-G+RW-G+RW-R+RW-R.litmus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
C auto/C-RW-R+RW-R+RW-G+RW-G+RW-G+RW-G+RW-R+RW-R+RW-R+RW-R+RW-G+RW-G+RW-G+RW-G+RW-R+RW-R
(*
* Result: Never
*
* Process 0 starts (t=297999).
*
* P0 goes back a bit less than one grace period (t=198999).
*
* P1 goes back a bit less than one grace period (t=100000).
*
* P2 advances one grace period (t=200001).
*
* P3 advances one grace period (t=300002).
*
* P4 advances one grace period (t=400003).
*
* P5 advances one grace period (t=500004).
*
* P6 goes back a bit less than one grace period (t=401005).
*
* P7 goes back a bit less than one grace period (t=302006).
*
* P8 goes back a bit less than one grace period (t=203007).
*
* P9 goes back a bit less than one grace period (t=104008).
*
* P10 advances one grace period (t=204009).
*
* P11 advances one grace period (t=304010).
*
* P12 advances one grace period (t=404011).
*
* P13 advances one grace period (t=504012).
*
* P14 goes back a bit less than one grace period (t=405013).
*
* P15 goes back a bit less than one grace period (t=306014).
*
* Process 0 start at t=297999, process 16 end at t=306014: Cycle forbidden.
*)
{
}
P0(intptr_t *x0, intptr_t *x1)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x0);
WRITE_ONCE(*x1, 1);
rcu_read_unlock();
}
P1(intptr_t *x1, intptr_t *x2)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x1);
WRITE_ONCE(*x2, 1);
rcu_read_unlock();
}
P2(intptr_t *x2, intptr_t *x3)
{
intptr_t r1 = READ_ONCE(*x2);
synchronize_rcu();
WRITE_ONCE(*x3, 1);
}
P3(intptr_t *x3, intptr_t *x4)
{
intptr_t r1 = READ_ONCE(*x3);
synchronize_rcu();
WRITE_ONCE(*x4, 1);
}
P4(intptr_t *x4, intptr_t *x5)
{
intptr_t r1 = READ_ONCE(*x4);
synchronize_rcu();
WRITE_ONCE(*x5, 1);
}
P5(intptr_t *x5, intptr_t *x6)
{
intptr_t r1 = READ_ONCE(*x5);
synchronize_rcu();
WRITE_ONCE(*x6, 1);
}
P6(intptr_t *x6, intptr_t *x7)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x6);
WRITE_ONCE(*x7, 1);
rcu_read_unlock();
}
P7(intptr_t *x7, intptr_t *x8)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x7);
WRITE_ONCE(*x8, 1);
rcu_read_unlock();
}
P8(intptr_t *x8, intptr_t *x9)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x8);
WRITE_ONCE(*x9, 1);
rcu_read_unlock();
}
P9(intptr_t *x9, intptr_t *x10)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x9);
WRITE_ONCE(*x10, 1);
rcu_read_unlock();
}
P10(intptr_t *x10, intptr_t *x11)
{
intptr_t r1 = READ_ONCE(*x10);
synchronize_rcu();
WRITE_ONCE(*x11, 1);
}
P11(intptr_t *x11, intptr_t *x12)
{
intptr_t r1 = READ_ONCE(*x11);
synchronize_rcu();
WRITE_ONCE(*x12, 1);
}
P12(intptr_t *x12, intptr_t *x13)
{
intptr_t r1 = READ_ONCE(*x12);
synchronize_rcu();
WRITE_ONCE(*x13, 1);
}
P13(intptr_t *x13, intptr_t *x14)
{
intptr_t r1 = READ_ONCE(*x13);
synchronize_rcu();
WRITE_ONCE(*x14, 1);
}
P14(intptr_t *x14, intptr_t *x15)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x14);
WRITE_ONCE(*x15, 1);
rcu_read_unlock();
}
P15(intptr_t *x15, intptr_t *x0)
{
rcu_read_lock();
intptr_t r1 = READ_ONCE(*x15);
WRITE_ONCE(*x0, 1);
rcu_read_unlock();
}
exists
(0:r1=1 /\ 1:r1=1 /\ 2:r1=1 /\ 3:r1=1 /\ 4:r1=1 /\ 5:r1=1 /\ 6:r1=1 /\ 7:r1=1 /\ 8:r1=1 /\ 9:r1=1 /\ 10:r1=1 /\ 11:r1=1 /\ 12:r1=1 /\ 13:r1=1 /\ 14:r1=1 /\ 15:r1=1)