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