71b7ff5ebc
norm7 produces the 'normalized' name of a litmus test, when the test can be generated from a single cycle that passes through each process exactly once. The commit renames such tests in order to comply to the naming scheme implemented by this tool. Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Akira Yokosawa <akiyks@gmail.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: David Howells <dhowells@redhat.com> Cc: Jade Alglave <j.alglave@ucl.ac.uk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Luc Maranget <luc.maranget@inria.fr> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: linux-arch@vger.kernel.org Cc: parri.andrea@gmail.com Link: http://lkml.kernel.org/r/20180716180605.16115-14-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
30 lines
482 B
Text
30 lines
482 B
Text
C MP+fencewmbonceonce+fencermbonceonce
|
|
|
|
(*
|
|
* Result: Never
|
|
*
|
|
* This litmus test demonstrates that smp_wmb() and smp_rmb() provide
|
|
* sufficient ordering for the message-passing pattern. However, it
|
|
* is usually better to use smp_store_release() and smp_load_acquire().
|
|
*)
|
|
|
|
{}
|
|
|
|
P0(int *x, int *y)
|
|
{
|
|
WRITE_ONCE(*x, 1);
|
|
smp_wmb();
|
|
WRITE_ONCE(*y, 1);
|
|
}
|
|
|
|
P1(int *x, int *y)
|
|
{
|
|
int r0;
|
|
int r1;
|
|
|
|
r0 = READ_ONCE(*y);
|
|
smp_rmb();
|
|
r1 = READ_ONCE(*x);
|
|
}
|
|
|
|
exists (1:r0=1 /\ 1:r1=0)
|