mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 06:34:12 +08:00
8f32543b61
This commit adds comments to the litmus tests summarizing what these tests are intended to demonstrate. [ paulmck: Apply Andrea's and Alan's feedback. ] Suggested-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> 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: nborisov@suse.com Cc: npiggin@gmail.com Cc: parri.andrea@gmail.com Cc: stern@rowland.harvard.edu Cc: will.deacon@arm.com Link: http://lkml.kernel.org/r/1519169112-20593-4-git-send-email-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
44 lines
655 B
Plaintext
44 lines
655 B
Plaintext
C IRIW+poonceonces+OnceOnce
|
|
|
|
(*
|
|
* Result: Sometimes
|
|
*
|
|
* Test of independent reads from independent writes with nothing
|
|
* between each pairs of reads. In other words, is anything at all
|
|
* needed 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?
|
|
*)
|
|
|
|
{}
|
|
|
|
P0(int *x)
|
|
{
|
|
WRITE_ONCE(*x, 1);
|
|
}
|
|
|
|
P1(int *x, int *y)
|
|
{
|
|
int r0;
|
|
int r1;
|
|
|
|
r0 = READ_ONCE(*x);
|
|
r1 = READ_ONCE(*y);
|
|
}
|
|
|
|
P2(int *y)
|
|
{
|
|
WRITE_ONCE(*y, 1);
|
|
}
|
|
|
|
P3(int *x, int *y)
|
|
{
|
|
int r0;
|
|
int r1;
|
|
|
|
r0 = READ_ONCE(*y);
|
|
r1 = READ_ONCE(*x);
|
|
}
|
|
|
|
exists (1:r0=1 /\ 1:r1=0 /\ 3:r0=1 /\ 3:r1=0)
|