~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/memory-model/litmus-tests/README

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/memory-model/litmus-tests/README (Version linux-6.12-rc7) and /tools/memory-model/litmus-tests/README (Version linux-4.19.323)


  1 ============                                   !!   1 This directory contains the following litmus tests:
  2 LITMUS TESTS                                   << 
  3 ============                                   << 
  4                                                     2 
  5 CoRR+poonceonce+Once.litmus                         3 CoRR+poonceonce+Once.litmus
  6         Test of read-read coherence, that is,       4         Test of read-read coherence, that is, whether or not two
  7         successive reads from the same variabl      5         successive reads from the same variable are ordered.
  8                                                     6 
  9 CoRW+poonceonce+Once.litmus                         7 CoRW+poonceonce+Once.litmus
 10         Test of read-write coherence, that is,      8         Test of read-write coherence, that is, whether or not a read
 11         from a given variable followed by a wr      9         from a given variable followed by a write to that same variable
 12         are ordered.                               10         are ordered.
 13                                                    11 
 14 CoWR+poonceonce+Once.litmus                        12 CoWR+poonceonce+Once.litmus
 15         Test of write-read coherence, that is,     13         Test of write-read coherence, that is, whether or not a write
 16         to a given variable followed by a read     14         to a given variable followed by a read from that same variable
 17         are ordered.                               15         are ordered.
 18                                                    16 
 19 CoWW+poonceonce.litmus                             17 CoWW+poonceonce.litmus
 20         Test of write-write coherence, that is     18         Test of write-write coherence, that is, whether or not two
 21         successive writes to the same variable     19         successive writes to the same variable are ordered.
 22                                                    20 
 23 IRIW+fencembonceonces+OnceOnce.litmus              21 IRIW+fencembonceonces+OnceOnce.litmus
 24         Test of independent reads from indepen     22         Test of independent reads from independent writes with smp_mb()
 25         between each pairs of reads.  In other     23         between each pairs of reads.  In other words, is smp_mb()
 26         sufficient to cause two different read     24         sufficient to cause two different reading processes to agree on
 27         the order of a pair of writes, where e     25         the order of a pair of writes, where each write is to a different
 28         variable by a different process?  This     26         variable by a different process?  This litmus test is forbidden
 29         by LKMM's propagation rule.                27         by LKMM's propagation rule.
 30                                                    28 
 31 IRIW+poonceonces+OnceOnce.litmus                   29 IRIW+poonceonces+OnceOnce.litmus
 32         Test of independent reads from indepen     30         Test of independent reads from independent writes with nothing
 33         between each pairs of reads.  In other     31         between each pairs of reads.  In other words, is anything at all
 34         needed to cause two different reading      32         needed to cause two different reading processes to agree on the
 35         order of a pair of writes, where each      33         order of a pair of writes, where each write is to a different
 36         variable by a different process?           34         variable by a different process?
 37                                                    35 
 38 ISA2+pooncelock+pooncelock+pombonce.litmus         36 ISA2+pooncelock+pooncelock+pombonce.litmus
 39         Tests whether the ordering provided by     37         Tests whether the ordering provided by a lock-protected S
 40         litmus test is visible to an external      38         litmus test is visible to an external process whose accesses are
 41         separated by smp_mb().  This addition  !!  39         separated by smp_mb().  This addition of an external process to
 42         S is otherwise known as ISA2.              40         S is otherwise known as ISA2.
 43                                                    41 
 44 ISA2+poonceonces.litmus                            42 ISA2+poonceonces.litmus
 45         As below, but with store-release repla     43         As below, but with store-release replaced with WRITE_ONCE()
 46         and load-acquire replaced with READ_ON     44         and load-acquire replaced with READ_ONCE().
 47                                                    45 
 48 ISA2+pooncerelease+poacquirerelease+poacquireo     46 ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus
 49         Can a release-acquire chain order a pr     47         Can a release-acquire chain order a prior store against
 50         a later load?                              48         a later load?
 51                                                    49 
 52 LB+fencembonceonce+ctrlonceonce.litmus             50 LB+fencembonceonce+ctrlonceonce.litmus
 53         Does a control dependency and an smp_m     51         Does a control dependency and an smp_mb() suffice for the
 54         load-buffering litmus test, where each     52         load-buffering litmus test, where each process reads from one
 55         of two variables then writes to the ot     53         of two variables then writes to the other?
 56                                                    54 
 57 LB+poacquireonce+pooncerelease.litmus              55 LB+poacquireonce+pooncerelease.litmus
 58         Does a release-acquire pair suffice fo     56         Does a release-acquire pair suffice for the load-buffering
 59         litmus test, where each process reads      57         litmus test, where each process reads from one of two variables then
 60         writes to the other?                       58         writes to the other?
 61                                                    59 
 62 LB+poonceonces.litmus                              60 LB+poonceonces.litmus
 63         As above, but with store-release repla     61         As above, but with store-release replaced with WRITE_ONCE()
 64         and load-acquire replaced with READ_ON     62         and load-acquire replaced with READ_ONCE().
 65                                                    63 
 66 LB+unlocklockonceonce+poacquireonce.litmus     << 
 67         Does a unlock+lock pair provides order << 
 68         load and a store?                      << 
 69                                                << 
 70 MP+onceassign+derefonce.litmus                     64 MP+onceassign+derefonce.litmus
 71         As below, but with rcu_assign_pointer(     65         As below, but with rcu_assign_pointer() and an rcu_dereference().
 72                                                    66 
 73 MP+polockmbonce+poacquiresilsil.litmus             67 MP+polockmbonce+poacquiresilsil.litmus
 74         Protect the access with a lock and an      68         Protect the access with a lock and an smp_mb__after_spinlock()
 75         in one process, and use an acquire loa     69         in one process, and use an acquire load followed by a pair of
 76         spin_is_locked() calls in the other pr     70         spin_is_locked() calls in the other process.
 77                                                    71 
 78 MP+polockonce+poacquiresilsil.litmus               72 MP+polockonce+poacquiresilsil.litmus
 79         Protect the access with a lock in one      73         Protect the access with a lock in one process, and use an
 80         acquire load followed by a pair of spi     74         acquire load followed by a pair of spin_is_locked() calls
 81         in the other process.                      75         in the other process.
 82                                                    76 
 83 MP+polocks.litmus                                  77 MP+polocks.litmus
 84         As below, but with the second access o     78         As below, but with the second access of the writer process
 85         and the first access of reader process     79         and the first access of reader process protected by a lock.
 86                                                    80 
 87 MP+poonceonces.litmus                              81 MP+poonceonces.litmus
 88         As below, but without the smp_rmb() an     82         As below, but without the smp_rmb() and smp_wmb().
 89                                                    83 
 90 MP+pooncerelease+poacquireonce.litmus              84 MP+pooncerelease+poacquireonce.litmus
 91         As below, but with a release-acquire c     85         As below, but with a release-acquire chain.
 92                                                    86 
 93 MP+porevlocks.litmus                               87 MP+porevlocks.litmus
 94         As below, but with the first access of     88         As below, but with the first access of the writer process
 95         and the second access of reader proces     89         and the second access of reader process protected by a lock.
 96                                                    90 
 97 MP+unlocklockonceonce+fencermbonceonce.litmus  << 
 98         Does a unlock+lock pair provides order << 
 99         store and another store?               << 
100                                                << 
101 MP+fencewmbonceonce+fencermbonceonce.litmus        91 MP+fencewmbonceonce+fencermbonceonce.litmus
102         Does a smp_wmb() (between the stores)      92         Does a smp_wmb() (between the stores) and an smp_rmb() (between
103         the loads) suffice for the message-pas     93         the loads) suffice for the message-passing litmus test, where one
104         process writes data and then a flag, a     94         process writes data and then a flag, and the other process reads
105         the flag and then the data.  (This is      95         the flag and then the data.  (This is similar to the ISA2 tests,
106         but with two processes instead of thre     96         but with two processes instead of three.)
107                                                    97 
108 R+fencembonceonces.litmus                          98 R+fencembonceonces.litmus
109         This is the fully ordered (via smp_mb(     99         This is the fully ordered (via smp_mb()) version of one of
110         the classic counterintuitive litmus te    100         the classic counterintuitive litmus tests that illustrates the
111         effects of store propagation delays.      101         effects of store propagation delays.
112                                                   102 
113 R+poonceonces.litmus                              103 R+poonceonces.litmus
114         As above, but without the smp_mb() inv    104         As above, but without the smp_mb() invocations.
115                                                   105 
116 SB+fencembonceonces.litmus                        106 SB+fencembonceonces.litmus
117         This is the fully ordered (again, via     107         This is the fully ordered (again, via smp_mb() version of store
118         buffering, which forms the core of Dek    108         buffering, which forms the core of Dekker's mutual-exclusion
119         algorithm.                                109         algorithm.
120                                                   110 
121 SB+poonceonces.litmus                             111 SB+poonceonces.litmus
122         As above, but without the smp_mb() inv    112         As above, but without the smp_mb() invocations.
123                                                   113 
124 SB+rfionceonce-poonceonces.litmus                 114 SB+rfionceonce-poonceonces.litmus
125         This litmus test demonstrates that LKM    115         This litmus test demonstrates that LKMM is not fully multicopy
126         atomic.  (Neither is it other multicop    116         atomic.  (Neither is it other multicopy atomic.)  This litmus test
127         also demonstrates the "locations" debu    117         also demonstrates the "locations" debugging aid, which designates
128         additional registers and locations to     118         additional registers and locations to be printed out in the dump
129         of final states in the herd7 output.      119         of final states in the herd7 output.  Without the "locations"
130         statement, only those registers and lo    120         statement, only those registers and locations mentioned in the
131         "exists" clause will be printed.          121         "exists" clause will be printed.
132                                                   122 
133 S+poonceonces.litmus                              123 S+poonceonces.litmus
134         As below, but without the smp_wmb() an    124         As below, but without the smp_wmb() and acquire load.
135                                                   125 
136 S+fencewmbonceonce+poacquireonce.litmus           126 S+fencewmbonceonce+poacquireonce.litmus
137         Can a smp_wmb(), instead of a release,    127         Can a smp_wmb(), instead of a release, and an acquire order
138         a prior store against a subsequent sto    128         a prior store against a subsequent store?
139                                                   129 
140 WRC+poonceonces+Once.litmus                       130 WRC+poonceonces+Once.litmus
141 WRC+pooncerelease+fencermbonceonce+Once.litmus    131 WRC+pooncerelease+fencermbonceonce+Once.litmus
142         These two are members of an extension     132         These two are members of an extension of the MP litmus-test
143         class in which the first write is move    133         class in which the first write is moved to a separate process.
144         The second is forbidden because smp_st    134         The second is forbidden because smp_store_release() is
145         A-cumulative in LKMM.                     135         A-cumulative in LKMM.
146                                                   136 
147 Z6.0+pooncelock+pooncelock+pombonce.litmus        137 Z6.0+pooncelock+pooncelock+pombonce.litmus
148         Is the ordering provided by a spin_unl    138         Is the ordering provided by a spin_unlock() and a subsequent
149         spin_lock() sufficient to make orderin    139         spin_lock() sufficient to make ordering apparent to accesses
150         by a process not holding the lock?        140         by a process not holding the lock?
151                                                   141 
152 Z6.0+pooncelock+poonceLock+pombonce.litmus        142 Z6.0+pooncelock+poonceLock+pombonce.litmus
153         As above, but with smp_mb__after_spinl    143         As above, but with smp_mb__after_spinlock() immediately
154         following the spin_lock().                144         following the spin_lock().
155                                                   145 
156 Z6.0+pooncerelease+poacquirerelease+fencembonc    146 Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus
157         Is the ordering provided by a release-    147         Is the ordering provided by a release-acquire chain sufficient
158         to make ordering apparent to accesses     148         to make ordering apparent to accesses by a process that does
159         not participate in that release-acquir    149         not participate in that release-acquire chain?
160                                                   150 
161 A great many more litmus tests are available h    151 A great many more litmus tests are available here:
162                                                   152 
163         https://github.com/paulmckrcu/litmus      153         https://github.com/paulmckrcu/litmus
164                                                << 
165 ==================                             << 
166 LITMUS TEST NAMING                             << 
167 ==================                             << 
168                                                << 
169 Litmus tests are usually named based on their  << 
170 looking at the name tells you what the litmus  << 
171 scheme covers litmus tests having a single cyc << 
172 each process exactly once, so litmus tests not << 
173 are named on an ad-hoc basis.                  << 
174                                                << 
175 The structure of a litmus-test name is the lit << 
176 sign ("+"), and one string for each process, s << 
177 The end of the name is ".litmus".              << 
178                                                << 
179 The litmus-test classes may be found in the in << 
180 https://www.cl.cam.ac.uk/~pes20/ppc-supplement << 
181 Each class defines the pattern of accesses and << 
182 For example, if the one process writes to a pa << 
183 the other process reads from these same variab << 
184 litmus-test class is "MP" (message passing), w << 
185 left-hand end of the second row of tests on pa << 
186                                                << 
187 The strings used to identify the actions carri << 
188 complex due to a desire to have short(er) name << 
189 generate these strings from a given litmus tes << 
190 consider the processes from SB+rfionceonce-poo << 
191                                                << 
192         P0(int *x, int *y)                     << 
193         {                                      << 
194                 int r1;                        << 
195                 int r2;                        << 
196                                                << 
197                 WRITE_ONCE(*x, 1);             << 
198                 r1 = READ_ONCE(*x);            << 
199                 r2 = READ_ONCE(*y);            << 
200         }                                      << 
201                                                << 
202         P1(int *x, int *y)                     << 
203         {                                      << 
204                 int r3;                        << 
205                 int r4;                        << 
206                                                << 
207                 WRITE_ONCE(*y, 1);             << 
208                 r3 = READ_ONCE(*y);            << 
209                 r4 = READ_ONCE(*x);            << 
210         }                                      << 
211                                                << 
212 The next step is to construct a space-separate << 
213 interleaving descriptions of the relation betw << 
214 accesses with descriptions of the second acces << 
215                                                << 
216 P0()'s WRITE_ONCE() is read by its first READ_ << 
217 reads-from link (rf) and internal to the P0()  << 
218 "rfi", which is an abbreviation for "reads-fro << 
219 some of the tools string these abbreviations t << 
220 characters separating processes, the first cha << 
221 resulting in "Rfi".                            << 
222                                                << 
223 P0()'s second access is a READ_ONCE(), as oppo << 
224 smp_load_acquire(), so next is "Once".  Thus f << 
225                                                << 
226 P0()'s third access is also a READ_ONCE(), but << 
227 This is related to P0()'s second access by pro << 
228 to a different variable ("d"), and both access << 
229 The resulting descriptor is "PodRR".  Because  << 
230 READ_ONCE(), we add another "Once" descriptor. << 
231                                                << 
232 A from-read ("fre") relation links P0()'s thir << 
233 access, and the resulting descriptor is "Fre". << 
234 WRITE_ONCE(), which as before gives the descri << 
235 thus far is thus "Rfi Once PodRR Once Fre Once << 
236                                                << 
237 The remainder of P1() is similar to P0(), whic << 
238 "Rfi Once PodRR Once".  Another fre links P1() << 
239 P0()'s first access, which is WRITE_ONCE(), so << 
240 The full string is thus:                       << 
241                                                << 
242         Rfi Once PodRR Once Fre Once Rfi Once  << 
243                                                << 
244 This string can be given to the "norm7" and "c << 
245 produce the name:                              << 
246                                                << 
247         $ norm7 -bell linux-kernel.bell \      << 
248                 Rfi Once PodRR Once Fre Once R << 
249           sed -e 's/:.*//g'                    << 
250         SB+rfionceonce-poonceonces             << 
251                                                << 
252 Adding the ".litmus" suffix: SB+rfionceonce-po << 
253                                                << 
254 The descriptors that describe connections betw << 
255 within the cycle through a given litmus test c << 
256 tool (Rfi, Po, Fre, and so on) or by the linux << 
257 Release, Acquire, and so on).                  << 
258                                                << 
259 To see the full list of descriptors, execute t << 
260                                                << 
261         $ diyone7 -bell linux-kernel.bell -sho << 
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php