Skip to content

Commit 4a9cc65

Browse files
fbqpaulmckrcu
authored andcommitted
tools/memory-model: Add an exception for limitations on _unless() family
According to Luc, atomic_add_unless() is directly provided by herd7, therefore it can be used in litmus tests. So change the limitation section in README to unlimit the use of atomic_add_unless(). Cc: Luc Maranget <[email protected]> Acked-by: Andrea Parri <[email protected]> Reviewed-by: Joel Fernandes (Google) <[email protected]> Signed-off-by: Boqun Feng <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 7f87133 commit 4a9cc65

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/memory-model/README

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,15 @@ The Linux-kernel memory model (LKMM) has the following limitations:
207207
case as a store release.
208208

209209
b. The "unless" RMW operations are not currently modeled:
210-
atomic_long_add_unless(), atomic_add_unless(),
211-
atomic_inc_unless_negative(), and
212-
atomic_dec_unless_positive(). These can be emulated
210+
atomic_long_add_unless(), atomic_inc_unless_negative(),
211+
and atomic_dec_unless_positive(). These can be emulated
213212
in litmus tests, for example, by using atomic_cmpxchg().
214213

214+
One exception of this limitation is atomic_add_unless(),
215+
which is provided directly by herd7 (so no corresponding
216+
definition in linux-kernel.def). atomic_add_unless() is
217+
modeled by herd7 therefore it can be used in litmus tests.
218+
215219
c. The call_rcu() function is not modeled. It can be
216220
emulated in litmus tests by adding another process that
217221
invokes synchronize_rcu() and the body of the callback

0 commit comments

Comments
 (0)