All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] advsync: Add litmus tests of control dependency
@ 2017-07-17 14:28 Akira Yokosawa
  2017-07-19 17:44 ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Akira Yokosawa @ 2017-07-17 14:28 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 892d8e1014c5bca1c83fbc35bcc1951c6c497b7f Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Mon, 17 Jul 2017 20:56:19 +0900
Subject: [RFC PATCH] advsync: Add litmus tests of control dependency

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
Hi Paul,

So I converted the 2 examples of control dependency to litmus tests.
I mentioned the name "C-SB+o-c-o+o-c-o", but it should have been
"C-LB+o-c-o+o-c-o".

They correspond to the example after the partial revert to the
two-CPU example I submitted earlier.

Do they make sense?

          Thanks, Akira
--
 CodeSamples/advsync/herd/C-LB+o-c-o+o-c-o.litmus   | 27 ++++++++++++++++++
 .../advsync/herd/C-WWC+o-c-o+o-c-o+o.litmus        | 32 ++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 CodeSamples/advsync/herd/C-LB+o-c-o+o-c-o.litmus
 create mode 100644 CodeSamples/advsync/herd/C-WWC+o-c-o+o-c-o+o.litmus

diff --git a/CodeSamples/advsync/herd/C-LB+o-c-o+o-c-o.litmus b/CodeSamples/advsync/herd/C-LB+o-c-o+o-c-o.litmus
new file mode 100644
index 0000000..023af2e
--- /dev/null
+++ b/CodeSamples/advsync/herd/C-LB+o-c-o+o-c-o.litmus
@@ -0,0 +1,27 @@
+C C-LB+o-c-o+o-c-o
+{
+}
+
+{
+#include "api.h"
+}
+
+P0(int *x, int *y)
+{
+	int r1;
+
+	r1 = READ_ONCE(*x);
+	if (r1 >= 0)
+		WRITE_ONCE(*y, 1);
+}
+
+P1(int *x, int *y)
+{
+	int r2;
+
+	r2 = READ_ONCE(*y);
+	if (r2 >= 0)
+		WRITE_ONCE(*x, 1);
+}
+
+exists (0:r1=1 /\ 1:r2=1)
diff --git a/CodeSamples/advsync/herd/C-WWC+o-c-o+o-c-o+o.litmus b/CodeSamples/advsync/herd/C-WWC+o-c-o+o-c-o+o.litmus
new file mode 100644
index 0000000..80dc2f6
--- /dev/null
+++ b/CodeSamples/advsync/herd/C-WWC+o-c-o+o-c-o+o.litmus
@@ -0,0 +1,32 @@
+C C-WWC+o-c-o+o-c-o+o
+{
+}
+
+{
+#include "api.h"
+}
+
+P0(int *x, int *y)
+{
+	int r1;
+
+	r1 = READ_ONCE(*x);
+	if (r1 >= 0)
+		WRITE_ONCE(*y, 1);
+}
+
+P1(int *x, int *y)
+{
+	int r2;
+
+	r2 = READ_ONCE(*y);
+	if (r2 >= 0)
+		WRITE_ONCE(*x, 1);
+}
+
+P2(int *x)
+{
+	WRITE_ONCE(*x, 2);
+}
+
+exists (0:r1=2 /\ 1:r2=1 /\ x=2)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-25 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-17 14:28 [RFC PATCH] advsync: Add litmus tests of control dependency Akira Yokosawa
2017-07-19 17:44 ` Paul E. McKenney
2017-07-23  4:16   ` [PATCH v2] " Akira Yokosawa
2017-07-25 19:44     ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.