mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 06:34:12 +08:00
1bd3742043
This commit flags WRC+pooncerelease+rmbonceonce+Once.litmus as being forbidden by smp_store_release() A-cumulativity and IRIW+mbonceonces+OnceOnce.litmus as being forbidden by the LKMM propagation rule. Suggested-by: Andrea Parri <andrea.parri@amarulasolutions.com> Reported-by: Paolo Bonzini <pbonzini@redhat.com> [ paulmck: Updated wording as suggested by Alan Stern. ] Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: akiyks@gmail.com Cc: boqun.feng@gmail.com Cc: dhowells@redhat.com Cc: j.alglave@ucl.ac.uk Cc: linux-arch@vger.kernel.org Cc: luc.maranget@inria.fr Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Link: http://lkml.kernel.org/r/1526340837-12222-11-git-send-email-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
46 lines
726 B
Plaintext
46 lines
726 B
Plaintext
C IRIW+mbonceonces+OnceOnce
|
|
|
|
(*
|
|
* Result: Never
|
|
*
|
|
* Test of independent reads from independent writes with smp_mb()
|
|
* between each pairs of reads. In other words, is smp_mb() sufficient to
|
|
* cause two different reading processes to agree on the order of a pair
|
|
* of writes, where each write is to a different variable by a different
|
|
* process? This litmus test exercises LKMM's "propagation" rule.
|
|
*)
|
|
|
|
{}
|
|
|
|
P0(int *x)
|
|
{
|
|
WRITE_ONCE(*x, 1);
|
|
}
|
|
|
|
P1(int *x, int *y)
|
|
{
|
|
int r0;
|
|
int r1;
|
|
|
|
r0 = READ_ONCE(*x);
|
|
smp_mb();
|
|
r1 = READ_ONCE(*y);
|
|
}
|
|
|
|
P2(int *y)
|
|
{
|
|
WRITE_ONCE(*y, 1);
|
|
}
|
|
|
|
P3(int *x, int *y)
|
|
{
|
|
int r0;
|
|
int r1;
|
|
|
|
r0 = READ_ONCE(*y);
|
|
smp_mb();
|
|
r1 = READ_ONCE(*x);
|
|
}
|
|
|
|
exists (1:r0=1 /\ 1:r1=0 /\ 3:r0=1 /\ 3:r1=0)
|