summaryrefslogtreecommitdiff
path: root/tools/memory-model/litmus-tests/MP+polocks.litmus
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-11-06 00:39:28 +0300
committerPaul E. McKenney <paulmck@kernel.org>2020-11-07 04:25:17 +0300
commitb6ff30849ca723b78306514246b98ca5645d92f5 (patch)
treeb4110e2cd58cfd0988663fded8e780aae8ba8e47 /tools/memory-model/litmus-tests/MP+polocks.litmus
parentacc4bdc55dcb7d7fe0be736999572a55e121873f (diff)
downloadlinux-b6ff30849ca723b78306514246b98ca5645d92f5.tar.xz
tools/memory-model: Label MP tests' producers and consumers
This commit adds comments that label the MP tests' producer and consumer processes, and also that label the "exists" clause as the bad outcome. Reported-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/memory-model/litmus-tests/MP+polocks.litmus')
-rw-r--r--tools/memory-model/litmus-tests/MP+polocks.litmus6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/memory-model/litmus-tests/MP+polocks.litmus b/tools/memory-model/litmus-tests/MP+polocks.litmus
index 4b0c2edcc029..21cbca6f3be4 100644
--- a/tools/memory-model/litmus-tests/MP+polocks.litmus
+++ b/tools/memory-model/litmus-tests/MP+polocks.litmus
@@ -17,7 +17,7 @@ C MP+polocks
int flag;
}
-P0(int *buf, int *flag, spinlock_t *mylock)
+P0(int *buf, int *flag, spinlock_t *mylock) // Producer
{
WRITE_ONCE(*buf, 1);
spin_lock(mylock);
@@ -25,7 +25,7 @@ P0(int *buf, int *flag, spinlock_t *mylock)
spin_unlock(mylock);
}
-P1(int *buf, int *flag, spinlock_t *mylock)
+P1(int *buf, int *flag, spinlock_t *mylock) // Consumer
{
int r0;
int r1;
@@ -36,4 +36,4 @@ P1(int *buf, int *flag, spinlock_t *mylock)
r1 = READ_ONCE(*buf);
}
-exists (1:r0=1 /\ 1:r1=0)
+exists (1:r0=1 /\ 1:r1=0) (* Bad outcome. *)