2020-03-23 01:58:52

by Joel Fernandes

[permalink] [raw]
Subject: [PATCH v2 1/4] Documentation: LKMM: Move MP+onceassign+derefonce to new litmus-tests/rcu/

Move MP+onceassign+derefonce to the new Documentation/litmus-tests/rcu/
directory.

More RCU-related litmus tests would be added here.

Signed-off-by: Joel Fernandes (Google) <[email protected]>

---
Cc: [email protected]

Documentation/litmus-tests/README | 9 +++++++++
.../litmus-tests/rcu}/MP+onceassign+derefonce.litmus | 0
tools/memory-model/litmus-tests/README | 3 ---
3 files changed, 9 insertions(+), 3 deletions(-)
create mode 100644 Documentation/litmus-tests/README
rename {tools/memory-model/litmus-tests => Documentation/litmus-tests/rcu}/MP+onceassign+derefonce.litmus (100%)

diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
new file mode 100644
index 0000000000000..84208bc197f2e
--- /dev/null
+++ b/Documentation/litmus-tests/README
@@ -0,0 +1,9 @@
+============
+LITMUS TESTS
+============
+
+RCU (/rcu directory)
+--------------------
+MP+onceassign+derefonce.litmus
+ Demonstrates that rcu_assign_pointer() and rcu_dereference() to
+ ensure that an RCU reader will not see pre-initialization garbage.
diff --git a/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus b/Documentation/litmus-tests/rcu/MP+onceassign+derefonce.litmus
similarity index 100%
rename from tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus
rename to Documentation/litmus-tests/rcu/MP+onceassign+derefonce.litmus
diff --git a/tools/memory-model/litmus-tests/README b/tools/memory-model/litmus-tests/README
index 681f9067fa9ed..79e1b1ed4929a 100644
--- a/tools/memory-model/litmus-tests/README
+++ b/tools/memory-model/litmus-tests/README
@@ -63,9 +63,6 @@ LB+poonceonces.litmus
As above, but with store-release replaced with WRITE_ONCE()
and load-acquire replaced with READ_ONCE().

-MP+onceassign+derefonce.litmus
- As below, but with rcu_assign_pointer() and an rcu_dereference().
-
MP+polockmbonce+poacquiresilsil.litmus
Protect the access with a lock and an smp_mb__after_spinlock()
in one process, and use an acquire load followed by a pair of
--
2.25.1.696.g5e7596f4ac-goog


2020-03-23 01:59:01

by Joel Fernandes

[permalink] [raw]
Subject: [PATCH v2 2/4] Documentation: LKMM: Add litmus test for RCU GP guarantee where updater frees object

This adds an example for the important RCU grace period guarantee, which
shows an RCU reader can never span a grace period.

Signed-off-by: Joel Fernandes (Google) <[email protected]>
---
.../litmus-tests/rcu/RCU+sync+free.litmus | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/litmus-tests/rcu/RCU+sync+free.litmus

diff --git a/Documentation/litmus-tests/rcu/RCU+sync+free.litmus b/Documentation/litmus-tests/rcu/RCU+sync+free.litmus
new file mode 100644
index 0000000000000..4ee67e12f513a
--- /dev/null
+++ b/Documentation/litmus-tests/rcu/RCU+sync+free.litmus
@@ -0,0 +1,42 @@
+C RCU+sync+free
+
+(*
+ * Result: Never
+ *
+ * This litmus test demonstrates that an RCU reader can never see a write that
+ * follows a grace period, if it did not see writes that precede that grace
+ * period.
+ *
+ * This is a typical pattern of RCU usage, where the write before the grace
+ * period assigns a pointer, and the writes following the grace period destroy
+ * the object that the pointer used to point to.
+ *
+ * This is one implication of the RCU grace-period guarantee, which says (among
+ * other things) that an RCU read-side critical section cannot span a grace period.
+ *)
+
+{
+int x = 1;
+int *y = &x;
+int z = 1;
+}
+
+P0(int *x, int *z, int **y)
+{
+ int *r0;
+ int r1;
+
+ rcu_read_lock();
+ r0 = rcu_dereference(*y);
+ r1 = READ_ONCE(*r0);
+ rcu_read_unlock();
+}
+
+P1(int *x, int *z, int **y)
+{
+ rcu_assign_pointer(*y, z);
+ synchronize_rcu();
+ WRITE_ONCE(*x, 0);
+}
+
+exists (0:r0=x /\ 0:r1=0)
--
2.25.1.696.g5e7596f4ac-goog

2020-03-23 01:59:35

by Joel Fernandes

[permalink] [raw]
Subject: [PATCH v2 3/4] Documentation: LKMM: Add litmus test for RCU GP guarantee where reader stores

This adds an example for the important RCU grace period guarantee, which
shows an RCU reader can never span a grace period.

Signed-off-by: Joel Fernandes (Google) <[email protected]>
---
Documentation/litmus-tests/README | 5 +++
.../litmus-tests/rcu/RCU+sync+read.litmus | 37 +++++++++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 Documentation/litmus-tests/rcu/RCU+sync+read.litmus

diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
index 84208bc197f2e..79d187f75679d 100644
--- a/Documentation/litmus-tests/README
+++ b/Documentation/litmus-tests/README
@@ -7,3 +7,8 @@ RCU (/rcu directory)
MP+onceassign+derefonce.litmus
Demonstrates that rcu_assign_pointer() and rcu_dereference() to
ensure that an RCU reader will not see pre-initialization garbage.
+
+RCU+sync+read.litmus
+RCU+sync+free.litmus
+ Both the above litmus tests demonstrate the RCU grace period guarantee
+ that an RCU read-side critical section can never span a grace period.
diff --git a/Documentation/litmus-tests/rcu/RCU+sync+read.litmus b/Documentation/litmus-tests/rcu/RCU+sync+read.litmus
new file mode 100644
index 0000000000000..f34176720231d
--- /dev/null
+++ b/Documentation/litmus-tests/rcu/RCU+sync+read.litmus
@@ -0,0 +1,37 @@
+C RCU+sync+read
+
+(*
+ * Result: Never
+ *
+ * This litmus test demonstrates that after a grace period, an RCU updater always
+ * sees all stores done in prior RCU read-side critical sections. Such
+ * read-side critical sections would have ended before the grace period ended.
+ *
+ * This is one implication of the RCU grace-period guarantee, which says (among
+ * other things) that an RCU read-side critical section cannot span a grace period.
+ *)
+
+{
+int x = 0;
+int y = 0;
+}
+
+P0(int *x, int *y)
+{
+ rcu_read_lock();
+ WRITE_ONCE(*x, 1);
+ WRITE_ONCE(*y, 1);
+ rcu_read_unlock();
+}
+
+P1(int *x, int *y)
+{
+ int r0;
+ int r1;
+
+ r0 = READ_ONCE(*x);
+ synchronize_rcu();
+ r1 = READ_ONCE(*y);
+}
+
+exists (1:r0=1 /\ 1:r1=0)
--
2.25.1.696.g5e7596f4ac-goog

2020-05-09 03:47:51

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] Documentation: LKMM: Move MP+onceassign+derefonce to new litmus-tests/rcu/

Hi Joel,

Sorry for the late response but I've noticed some glitches.

On Sun, 22 Mar 2020 21:57:32 -0400, Joel Fernandes (Google) wrote:
> Move MP+onceassign+derefonce to the new Documentation/litmus-tests/rcu/
> directory.

MP+onceassign+derefonce.litmus is called out in
tools/memory-model/Documentation/recipes.txt as a representative example
of RCU related litmus test.

So I think it should be kept under tools/memory-model/litmus-tests.

Further RCU-related litmus tests can be added under Documentation/litmus-tests/.

IIUC, this change is not picked up by tip tree yet. So we have time to respin
the series targeting v5.9.

>
> More RCU-related litmus tests would be added here.
>
> Signed-off-by: Joel Fernandes (Google) <[email protected]>
>
> ---
> Cc: [email protected]
>
> Documentation/litmus-tests/README | 9 +++++++++

Please note that later patches to add atomic litmus tests under
Documentation/litmus-tests/ by Boqun put README as
Documentation/litums-tests/atomic/README.

This patch's location of RCU's README as Documentation/litmus-tests/README
looks asymmetric to me.

I'm OK with either merging atomic's README with the top-level one or
moving RCU's README to under Documentation/litmus-tests/rcu.

Joel, Boqum, can you sort out the location of README?

Thanks, Akira

> .../litmus-tests/rcu}/MP+onceassign+derefonce.litmus | 0
> tools/memory-model/litmus-tests/README | 3 ---
> 3 files changed, 9 insertions(+), 3 deletions(-)
> create mode 100644 Documentation/litmus-tests/README
> rename {tools/memory-model/litmus-tests => Documentation/litmus-tests/rcu}/MP+onceassign+derefonce.litmus (100%)
>
> diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> new file mode 100644
> index 0000000000000..84208bc197f2e
> --- /dev/null
> +++ b/Documentation/litmus-tests/README
> @@ -0,0 +1,9 @@
> +============
> +LITMUS TESTS
> +============
> +
> +RCU (/rcu directory)
> +--------------------
> +MP+onceassign+derefonce.litmus
> + Demonstrates that rcu_assign_pointer() and rcu_dereference() to
> + ensure that an RCU reader will not see pre-initialization garbage.
> diff --git a/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus b/Documentation/litmus-tests/rcu/MP+onceassign+derefonce.litmus
> similarity index 100%
> rename from tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus
> rename to Documentation/litmus-tests/rcu/MP+onceassign+derefonce.litmus
> diff --git a/tools/memory-model/litmus-tests/README b/tools/memory-model/litmus-tests/README
> index 681f9067fa9ed..79e1b1ed4929a 100644
> --- a/tools/memory-model/litmus-tests/README
> +++ b/tools/memory-model/litmus-tests/README
> @@ -63,9 +63,6 @@ LB+poonceonces.litmus
> As above, but with store-release replaced with WRITE_ONCE()
> and load-acquire replaced with READ_ONCE().
>
> -MP+onceassign+derefonce.litmus
> - As below, but with rcu_assign_pointer() and an rcu_dereference().
> -
> MP+polockmbonce+poacquiresilsil.litmus
> Protect the access with a lock and an smp_mb__after_spinlock()
> in one process, and use an acquire load followed by a pair of
>

2020-05-10 07:27:12

by Akira Yokosawa

[permalink] [raw]
Subject: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Sat, 9 May 2020 12:43:30 +0900, Akira Yokosawa wrote:
> Hi Joel,
>
> Sorry for the late response but I've noticed some glitches.
>
> On Sun, 22 Mar 2020 21:57:32 -0400, Joel Fernandes (Google) wrote:
>> Move MP+onceassign+derefonce to the new Documentation/litmus-tests/rcu/
>> directory.
>
> MP+onceassign+derefonce.litmus is called out in
> tools/memory-model/Documentation/recipes.txt as a representative example
> of RCU related litmus test.
>
> So I think it should be kept under tools/memory-model/litmus-tests.
>
> Further RCU-related litmus tests can be added under Documentation/litmus-tests/.
>
> IIUC, this change is not picked up by tip tree yet. So we have time to respin
> the series targeting v5.9.
>
>>
>> More RCU-related litmus tests would be added here.
>>
>> Signed-off-by: Joel Fernandes (Google) <[email protected]>
>>
>> ---
>> Cc: [email protected]
>>
>> Documentation/litmus-tests/README | 9 +++++++++
>
> Please note that later patches to add atomic litmus tests under
> Documentation/litmus-tests/ by Boqun put README as
> Documentation/litums-tests/atomic/README.
>
> This patch's location of RCU's README as Documentation/litmus-tests/README
> looks asymmetric to me.
>
> I'm OK with either merging atomic's README with the top-level one or
> moving RCU's README to under Documentation/litmus-tests/rcu.
>
> Joel, Boqum, can you sort out the location of README?

So something like this?

Patch 1/3 is an independent typo fix in recipes.txt.
Patch 2/3 reverts the MP+onceassign+derefonce relocation.
Patch 3/3 merges atomic's README into the top-level one.

This is relative to -rcu's lkmm branch.

Thoughts?

Thanks, Akira
--
Akira Yokosawa (3):
tools/memory-model: Fix reference to litmus test in recipes.txt
Revert "Documentation: LKMM: Move MP+onceassign+derefonce to new
litmus-tests/rcu/"
Documentation/litmus-tests: Merge atomic's README into top-level one

Documentation/litmus-tests/README | 22 ++++++++++++++++---
Documentation/litmus-tests/atomic/README | 16 --------------
tools/memory-model/Documentation/recipes.txt | 2 +-
.../MP+onceassign+derefonce.litmus | 0
tools/memory-model/litmus-tests/README | 3 +++
5 files changed, 23 insertions(+), 20 deletions(-)
delete mode 100644 Documentation/litmus-tests/atomic/README
rename {Documentation/litmus-tests/rcu => tools/memory-model/litmus-tests}/MP+onceassign+derefonce.litmus (100%)

--
2.17.1


2020-05-10 07:27:12

by Akira Yokosawa

[permalink] [raw]
Subject: [PATCH 2/3] Revert "Documentation: LKMM: Move MP+onceassign+derefonce to new litmus-tests/rcu/"

From 898051fee51913f5b9bd01cab98beb8944ec50b2 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 10 May 2020 13:43:34 +0900
Subject: [PATCH 2/3] Revert "Documentation: LKMM: Move MP+onceassign+derefonce to new litmus-tests/rcu/"

This reverts commit a5cca3485d9206a9dbbc6f47d2a537e69b53cd82.

MP+onceassign+derefonce.litmus is called out from
tools/memory-model/Documentation/recipes.txt.
It should be in the same directory as the other representative tests
to help readers inspect it.

Signed-off-by: Akira Yokosawa <[email protected]>
---
Documentation/litmus-tests/README | 3 ---
.../memory-model/litmus-tests}/MP+onceassign+derefonce.litmus | 0
tools/memory-model/litmus-tests/README | 3 +++
3 files changed, 3 insertions(+), 3 deletions(-)
rename {Documentation/litmus-tests/rcu => tools/memory-model/litmus-tests}/MP+onceassign+derefonce.litmus (100%)

diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
index 79d187f75679..c4307ea9f996 100644
--- a/Documentation/litmus-tests/README
+++ b/Documentation/litmus-tests/README
@@ -4,9 +4,6 @@ LITMUS TESTS

RCU (/rcu directory)
--------------------
-MP+onceassign+derefonce.litmus
- Demonstrates that rcu_assign_pointer() and rcu_dereference() to
- ensure that an RCU reader will not see pre-initialization garbage.

RCU+sync+read.litmus
RCU+sync+free.litmus
diff --git a/Documentation/litmus-tests/rcu/MP+onceassign+derefonce.litmus b/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus
similarity index 100%
rename from Documentation/litmus-tests/rcu/MP+onceassign+derefonce.litmus
rename to tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus
diff --git a/tools/memory-model/litmus-tests/README b/tools/memory-model/litmus-tests/README
index 79e1b1ed4929..681f9067fa9e 100644
--- a/tools/memory-model/litmus-tests/README
+++ b/tools/memory-model/litmus-tests/README
@@ -63,6 +63,9 @@ LB+poonceonces.litmus
As above, but with store-release replaced with WRITE_ONCE()
and load-acquire replaced with READ_ONCE().

+MP+onceassign+derefonce.litmus
+ As below, but with rcu_assign_pointer() and an rcu_dereference().
+
MP+polockmbonce+poacquiresilsil.litmus
Protect the access with a lock and an smp_mb__after_spinlock()
in one process, and use an acquire load followed by a pair of
--
2.17.1


2020-05-10 07:27:22

by Akira Yokosawa

[permalink] [raw]
Subject: [PATCH 1/3] tools/memory-model: Fix reference to litmus test in recipes.txt

From c171026a697d401ea5d2ad6656d0481944604b14 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 10 May 2020 13:37:14 +0900
Subject: [PATCH 1/3] tools/memory-model: Fix reference to litmus test in recipes.txt

The name of litmus test doesn't match the one described below.
Fix the name of litmus test.

Signed-off-by: Akira Yokosawa <[email protected]>
---
tools/memory-model/Documentation/recipes.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/memory-model/Documentation/recipes.txt b/tools/memory-model/Documentation/recipes.txt
index 7fe8d7aa3029..63c4adfed884 100644
--- a/tools/memory-model/Documentation/recipes.txt
+++ b/tools/memory-model/Documentation/recipes.txt
@@ -126,7 +126,7 @@ However, it is not necessarily the case that accesses ordered by
locking will be seen as ordered by CPUs not holding that lock.
Consider this example:

- /* See Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus. */
+ /* See Z6.0+pooncelock+pooncelock+pombonce.litmus. */
void CPU0(void)
{
spin_lock(&mylock);
--
2.17.1


2020-05-10 07:30:43

by Akira Yokosawa

[permalink] [raw]
Subject: [PATCH 3/3] Documentation/litmus-tests: Merge atomic's README into top-level one

From 1aa2c25f0ad16382a5bc597cdbdcc817645e01cd Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 10 May 2020 15:12:57 +0900
Subject: [PATCH 3/3] Documentation/litmus-tests: Merge atomic's README into top-level one

Where Documentation/litmus-tests/README lists RCU litmus tests,
Documentation/litmus-tests/atomic/README lists atomic litmus tests.
For symmetry, merge the latter into former, with some context
adjustment in the introduction.

Signed-off-by: Akira Yokosawa <[email protected]>
---
Documentation/litmus-tests/README | 19 +++++++++++++++++++
Documentation/litmus-tests/atomic/README | 16 ----------------
2 files changed, 19 insertions(+), 16 deletions(-)
delete mode 100644 Documentation/litmus-tests/atomic/README

diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
index c4307ea9f996..ac0b270b456c 100644
--- a/Documentation/litmus-tests/README
+++ b/Documentation/litmus-tests/README
@@ -2,6 +2,25 @@
LITMUS TESTS
============

+Each subdirectory contains litmus tests that are typical to describe the
+semantics of respective kernel APIs.
+For more information about how to "run" a litmus test or how to generate
+a kernel test module based on a litmus test, please see
+tools/memory-model/README.
+
+
+atomic (/atomic derectory)
+--------------------------
+
+Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
+ Test that an atomic RMW followed by a smp_mb__after_atomic() is
+ stronger than a normal acquire: both the read and write parts of
+ the RMW are ordered before the subsequential memory accesses.
+
+Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
+ Test that atomic_set() cannot break the atomicity of atomic RMWs.
+
+
RCU (/rcu directory)
--------------------

diff --git a/Documentation/litmus-tests/atomic/README b/Documentation/litmus-tests/atomic/README
deleted file mode 100644
index 714cf93816ea..000000000000
--- a/Documentation/litmus-tests/atomic/README
+++ /dev/null
@@ -1,16 +0,0 @@
-This directory contains litmus tests that are typical to describe the semantics
-of our atomic APIs. For more information about how to "run" a litmus test or
-how to generate a kernel test module based on a litmus test, please see
-tools/memory-model/README.
-
-============
-LITMUS TESTS
-============
-
-Atomic-RMW+mb__after_atomic-is-stronger-than-acquire
- Test that an atomic RMW followed by a smp_mb__after_atomic() is
- stronger than a normal acquire: both the read and write parts of
- the RMW are ordered before the subsequential memory accesses.
-
-Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
- Test that atomic_set() cannot break the atomicity of atomic RMWs.
--
2.17.1


2020-05-10 12:59:52

by Andrea Parri

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

> Akira Yokosawa (3):
> tools/memory-model: Fix reference to litmus test in recipes.txt
> Revert "Documentation: LKMM: Move MP+onceassign+derefonce to new
> litmus-tests/rcu/"
> Documentation/litmus-tests: Merge atomic's README into top-level one

For the series:

Acked-by: Andrea Parri <[email protected]>

Thanks,
Andrea


>
> Documentation/litmus-tests/README | 22 ++++++++++++++++---
> Documentation/litmus-tests/atomic/README | 16 --------------
> tools/memory-model/Documentation/recipes.txt | 2 +-
> .../MP+onceassign+derefonce.litmus | 0
> tools/memory-model/litmus-tests/README | 3 +++
> 5 files changed, 23 insertions(+), 20 deletions(-)
> delete mode 100644 Documentation/litmus-tests/atomic/README
> rename {Documentation/litmus-tests/rcu => tools/memory-model/litmus-tests}/MP+onceassign+derefonce.litmus (100%)
>
> --
> 2.17.1
>
>

2020-05-11 17:36:02

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Sun, May 10, 2020 at 04:21:02PM +0900, Akira Yokosawa wrote:
> On Sat, 9 May 2020 12:43:30 +0900, Akira Yokosawa wrote:
> > Hi Joel,
> >
> > Sorry for the late response but I've noticed some glitches.
> >
> > On Sun, 22 Mar 2020 21:57:32 -0400, Joel Fernandes (Google) wrote:
> >> Move MP+onceassign+derefonce to the new Documentation/litmus-tests/rcu/
> >> directory.
> >
> > MP+onceassign+derefonce.litmus is called out in
> > tools/memory-model/Documentation/recipes.txt as a representative example
> > of RCU related litmus test.
> >
> > So I think it should be kept under tools/memory-model/litmus-tests.
> >
> > Further RCU-related litmus tests can be added under Documentation/litmus-tests/.
> >
> > IIUC, this change is not picked up by tip tree yet. So we have time to respin
> > the series targeting v5.9.
> >
> >>
> >> More RCU-related litmus tests would be added here.
> >>
> >> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> >>
> >> ---
> >> Cc: [email protected]
> >>
> >> Documentation/litmus-tests/README | 9 +++++++++
> >
> > Please note that later patches to add atomic litmus tests under
> > Documentation/litmus-tests/ by Boqun put README as
> > Documentation/litums-tests/atomic/README.
> >
> > This patch's location of RCU's README as Documentation/litmus-tests/README
> > looks asymmetric to me.
> >
> > I'm OK with either merging atomic's README with the top-level one or
> > moving RCU's README to under Documentation/litmus-tests/rcu.
> >
> > Joel, Boqum, can you sort out the location of README?
>
> So something like this?
>
> Patch 1/3 is an independent typo fix in recipes.txt.
> Patch 2/3 reverts the MP+onceassign+derefonce relocation.
> Patch 3/3 merges atomic's README into the top-level one.
>
> This is relative to -rcu's lkmm branch.
>
> Thoughts?

Looks plausible to me, and thank you for reviewing this.

Joel, thoughts?

Thanx, Paul

> Thanks, Akira
> --
> Akira Yokosawa (3):
> tools/memory-model: Fix reference to litmus test in recipes.txt
> Revert "Documentation: LKMM: Move MP+onceassign+derefonce to new
> litmus-tests/rcu/"
> Documentation/litmus-tests: Merge atomic's README into top-level one
>
> Documentation/litmus-tests/README | 22 ++++++++++++++++---
> Documentation/litmus-tests/atomic/README | 16 --------------
> tools/memory-model/Documentation/recipes.txt | 2 +-
> .../MP+onceassign+derefonce.litmus | 0
> tools/memory-model/litmus-tests/README | 3 +++
> 5 files changed, 23 insertions(+), 20 deletions(-)
> delete mode 100644 Documentation/litmus-tests/atomic/README
> rename {Documentation/litmus-tests/rcu => tools/memory-model/litmus-tests}/MP+onceassign+derefonce.litmus (100%)
>
> --
> 2.17.1
>
>

2020-05-12 02:15:47

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Mon, May 11, 2020 at 10:33:48AM -0700, Paul E. McKenney wrote:
> On Sun, May 10, 2020 at 04:21:02PM +0900, Akira Yokosawa wrote:
> > On Sat, 9 May 2020 12:43:30 +0900, Akira Yokosawa wrote:
> > > Hi Joel,
> > >
> > > Sorry for the late response but I've noticed some glitches.
> > >
> > > On Sun, 22 Mar 2020 21:57:32 -0400, Joel Fernandes (Google) wrote:
> > >> Move MP+onceassign+derefonce to the new Documentation/litmus-tests/rcu/
> > >> directory.
> > >
> > > MP+onceassign+derefonce.litmus is called out in
> > > tools/memory-model/Documentation/recipes.txt as a representative example
> > > of RCU related litmus test.
> > >
> > > So I think it should be kept under tools/memory-model/litmus-tests.
> > >
> > > Further RCU-related litmus tests can be added under Documentation/litmus-tests/.
> > >
> > > IIUC, this change is not picked up by tip tree yet. So we have time to respin
> > > the series targeting v5.9.
> > >
> > >>
> > >> More RCU-related litmus tests would be added here.
> > >>
> > >> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> > >>
> > >> ---
> > >> Cc: [email protected]
> > >>
> > >> Documentation/litmus-tests/README | 9 +++++++++
> > >
> > > Please note that later patches to add atomic litmus tests under
> > > Documentation/litmus-tests/ by Boqun put README as
> > > Documentation/litums-tests/atomic/README.
> > >
> > > This patch's location of RCU's README as Documentation/litmus-tests/README
> > > looks asymmetric to me.
> > >
> > > I'm OK with either merging atomic's README with the top-level one or
> > > moving RCU's README to under Documentation/litmus-tests/rcu.
> > >
> > > Joel, Boqum, can you sort out the location of README?
> >
> > So something like this?
> >
> > Patch 1/3 is an independent typo fix in recipes.txt.
> > Patch 2/3 reverts the MP+onceassign+derefonce relocation.
> > Patch 3/3 merges atomic's README into the top-level one.
> >
> > This is relative to -rcu's lkmm branch.
> >
> > Thoughts?
>
> Looks plausible to me, and thank you for reviewing this.
>
> Joel, thoughts?

Sorry for the delays (OSPM conference in progress). I'm Ok with moving it
back to tools/memory-model/.

I think on top of this patch, I'd like to add a reference to the to the
litmus test in tools/memory-model/ from Documentation/rcu/.

Just to mention my rationale for Documentation/litmus-tests/rcu/, I was
basically looking for a central place for RCU related litmus tests in the
kernel sources and the idea of this new directory came up.

For Akira's series,
Acked-by: Joel Fernandes (Google) <[email protected]>

And could we add the following patch on top of Akira's series so we still
maintain a reference to the moved RCU test?

---8<-----------------------

From 52fdb57551cc769d8bd690f4f2b22de36ddece99 Mon Sep 17 00:00:00 2001
From: "Joel Fernandes (Google)" <[email protected]>
Date: Mon, 11 May 2020 22:06:46 -0400
Subject: [PATCH] docs: litmus-tests: Clarify about the RCU pre-initialization
test

Since this test was moved to tools/memory-model/, make sure that it is
at least referenced from Documentation/litmus-tests/'s README.

Signed-off-by: Joel Fernandes (Google) <[email protected]>
---
Documentation/litmus-tests/README | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
index ac0b270b456c1..53f09e74734a4 100644
--- a/Documentation/litmus-tests/README
+++ b/Documentation/litmus-tests/README
@@ -11,7 +11,6 @@ tools/memory-model/README.

atomic (/atomic derectory)
--------------------------
-
Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
Test that an atomic RMW followed by a smp_mb__after_atomic() is
stronger than a normal acquire: both the read and write parts of
@@ -23,8 +22,11 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus

RCU (/rcu directory)
--------------------
-
RCU+sync+read.litmus
RCU+sync+free.litmus
Both the above litmus tests demonstrate the RCU grace period guarantee
that an RCU read-side critical section can never span a grace period.
+
+MP+onceassign+derefonce.litmus (moved to tools/memory-model/litmus-tests/)
+ Demonstrates that rcu_assign_pointer() and rcu_dereference() to
+ ensure that an RCU reader will not see pre-initialization garbage.
--
2.26.2.645.ge9eca65c58-goog

2020-05-12 11:55:10

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Mon, 11 May 2020 22:13:09 -0400, Joel Fernandes wrote:
> On Mon, May 11, 2020 at 10:33:48AM -0700, Paul E. McKenney wrote:
>> On Sun, May 10, 2020 at 04:21:02PM +0900, Akira Yokosawa wrote:
>>> On Sat, 9 May 2020 12:43:30 +0900, Akira Yokosawa wrote:
>>>> Hi Joel,
>>>>
>>>> Sorry for the late response but I've noticed some glitches.
>>>>
>>>> On Sun, 22 Mar 2020 21:57:32 -0400, Joel Fernandes (Google) wrote:
>>>>> Move MP+onceassign+derefonce to the new Documentation/litmus-tests/rcu/
>>>>> directory.
>>>>
>>>> MP+onceassign+derefonce.litmus is called out in
>>>> tools/memory-model/Documentation/recipes.txt as a representative example
>>>> of RCU related litmus test.
>>>>
>>>> So I think it should be kept under tools/memory-model/litmus-tests.
>>>>
>>>> Further RCU-related litmus tests can be added under Documentation/litmus-tests/.
>>>>
>>>> IIUC, this change is not picked up by tip tree yet. So we have time to respin
>>>> the series targeting v5.9.
>>>>
>>>>>
>>>>> More RCU-related litmus tests would be added here.
>>>>>
>>>>> Signed-off-by: Joel Fernandes (Google) <[email protected]>
>>>>>
>>>>> ---
>>>>> Cc: [email protected]
>>>>>
>>>>> Documentation/litmus-tests/README | 9 +++++++++
>>>>
>>>> Please note that later patches to add atomic litmus tests under
>>>> Documentation/litmus-tests/ by Boqun put README as
>>>> Documentation/litums-tests/atomic/README.
>>>>
>>>> This patch's location of RCU's README as Documentation/litmus-tests/README
>>>> looks asymmetric to me.
>>>>
>>>> I'm OK with either merging atomic's README with the top-level one or
>>>> moving RCU's README to under Documentation/litmus-tests/rcu.
>>>>
>>>> Joel, Boqum, can you sort out the location of README?
>>>
>>> So something like this?
>>>
>>> Patch 1/3 is an independent typo fix in recipes.txt.
>>> Patch 2/3 reverts the MP+onceassign+derefonce relocation.
>>> Patch 3/3 merges atomic's README into the top-level one.
>>>
>>> This is relative to -rcu's lkmm branch.
>>>
>>> Thoughts?
>>
>> Looks plausible to me, and thank you for reviewing this.
>>
>> Joel, thoughts?
>
> Sorry for the delays (OSPM conference in progress). I'm Ok with moving it
> back to tools/memory-model/.
>
> I think on top of this patch, I'd like to add a reference to the to the
> litmus test in tools/memory-model/ from Documentation/rcu/.

Sounds reasonable to me. But for most people, it never changes its location.
Please find inline comments below.

>
> Just to mention my rationale for Documentation/litmus-tests/rcu/, I was
> basically looking for a central place for RCU related litmus tests in the
> kernel sources and the idea of this new directory came up.
>
> For Akira's series,
> Acked-by: Joel Fernandes (Google) <[email protected]>

Thank you!

>
> And could we add the following patch on top of Akira's series so we still
> maintain a reference to the moved RCU test?>
> ---8<-----------------------
>
> From 52fdb57551cc769d8bd690f4f2b22de36ddece99 Mon Sep 17 00:00:00 2001
> From: "Joel Fernandes (Google)" <[email protected]>
> Date: Mon, 11 May 2020 22:06:46 -0400
> Subject: [PATCH] docs: litmus-tests: Clarify about the RCU pre-initialization
> test
>
> Since this test was moved to tools/memory-model/, make sure that it is
> at least referenced from Documentation/litmus-tests/'s README.
>
> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> ---
> Documentation/litmus-tests/README | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> index ac0b270b456c1..53f09e74734a4 100644
> --- a/Documentation/litmus-tests/README
> +++ b/Documentation/litmus-tests/README
> @@ -11,7 +11,6 @@ tools/memory-model/README.
>
> atomic (/atomic derectory)
> --------------------------
> -
> Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
> Test that an atomic RMW followed by a smp_mb__after_atomic() is
> stronger than a normal acquire: both the read and write parts of
> @@ -23,8 +22,11 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
>
> RCU (/rcu directory)
> --------------------
> -

I loosely followed the convention of ReST documents in putting these empty
lines. But I don't mind if they are removed.

> RCU+sync+read.litmus
> RCU+sync+free.litmus
> Both the above litmus tests demonstrate the RCU grace period guarantee
> that an RCU read-side critical section can never span a grace period.
> +
> +MP+onceassign+derefonce.litmus (moved to tools/memory-model/litmus-tests/)

As I said above, for those who don't follow developments in the lkmm branch,
MP+onceassign+derefonce.litmus stays in tools/memory-model/litmus-tests/.
So,

+MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)

looks better to me.

Thanks, Akira

> + Demonstrates that rcu_assign_pointer() and rcu_dereference() to
> + ensure that an RCU reader will not see pre-initialization garbage.
>

2020-05-12 12:21:49

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Tue, May 12, 2020 at 08:50:45PM +0900, Akira Yokosawa wrote:
[...]
> > I think on top of this patch, I'd like to add a reference to the to the
> > litmus test in tools/memory-model/ from Documentation/rcu/.
>
> Sounds reasonable to me. But for most people, it never changes its location.
> Please find inline comments below.
>
> >
> > Just to mention my rationale for Documentation/litmus-tests/rcu/, I was
> > basically looking for a central place for RCU related litmus tests in the
> > kernel sources and the idea of this new directory came up.
> >
> > For Akira's series,
> > Acked-by: Joel Fernandes (Google) <[email protected]>
>
> Thank you!
>
> >
> > And could we add the following patch on top of Akira's series so we still
> > maintain a reference to the moved RCU test?>
> > ---8<-----------------------
> >
> > From 52fdb57551cc769d8bd690f4f2b22de36ddece99 Mon Sep 17 00:00:00 2001
> > From: "Joel Fernandes (Google)" <[email protected]>
> > Date: Mon, 11 May 2020 22:06:46 -0400
> > Subject: [PATCH] docs: litmus-tests: Clarify about the RCU pre-initialization
> > test
> >
> > Since this test was moved to tools/memory-model/, make sure that it is
> > at least referenced from Documentation/litmus-tests/'s README.
> >
> > Signed-off-by: Joel Fernandes (Google) <[email protected]>
> > ---
> > Documentation/litmus-tests/README | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> > index ac0b270b456c1..53f09e74734a4 100644
> > --- a/Documentation/litmus-tests/README
> > +++ b/Documentation/litmus-tests/README
> > @@ -11,7 +11,6 @@ tools/memory-model/README.
> >
> > atomic (/atomic derectory)
> > --------------------------
> > -
> > Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
> > Test that an atomic RMW followed by a smp_mb__after_atomic() is
> > stronger than a normal acquire: both the read and write parts of
> > @@ -23,8 +22,11 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
> >
> > RCU (/rcu directory)
> > --------------------
> > -
>
> I loosely followed the convention of ReST documents in putting these empty
> lines. But I don't mind if they are removed.
>
> > RCU+sync+read.litmus
> > RCU+sync+free.litmus
> > Both the above litmus tests demonstrate the RCU grace period guarantee
> > that an RCU read-side critical section can never span a grace period.
> > +
> > +MP+onceassign+derefonce.litmus (moved to tools/memory-model/litmus-tests/)
>
> As I said above, for those who don't follow developments in the lkmm branch,
> MP+onceassign+derefonce.litmus stays in tools/memory-model/litmus-tests/.
> So,
>
> +MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
>
> looks better to me.

Yes it stays under tools/.. but is referenced here. Sounds like you agree and
the only change from my follow-up patch that you want is to change "moved to"
to "under".

If so, Paul do you mind applying my patch and fixing this up? Or do you want
to apply Akira's 3-patch series first and then have me send you another one
on top?

thanks,

- Joel

2020-05-12 13:48:20

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Mon, 11 May 2020, Joel Fernandes wrote:

> From: "Joel Fernandes (Google)" <[email protected]>
> Date: Mon, 11 May 2020 22:06:46 -0400
> Subject: [PATCH] docs: litmus-tests: Clarify about the RCU pre-initialization
> test
>
> Since this test was moved to tools/memory-model/, make sure that it is
> at least referenced from Documentation/litmus-tests/'s README.
>
> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> ---
> Documentation/litmus-tests/README | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> index ac0b270b456c1..53f09e74734a4 100644
> --- a/Documentation/litmus-tests/README
> +++ b/Documentation/litmus-tests/README
> @@ -11,7 +11,6 @@ tools/memory-model/README.
>
> atomic (/atomic derectory)
> --------------------------
> -
> Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
> Test that an atomic RMW followed by a smp_mb__after_atomic() is
> stronger than a normal acquire: both the read and write parts of
> @@ -23,8 +22,11 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
>
> RCU (/rcu directory)
> --------------------
> -
> RCU+sync+read.litmus
> RCU+sync+free.litmus
> Both the above litmus tests demonstrate the RCU grace period guarantee
> that an RCU read-side critical section can never span a grace period.
> +
> +MP+onceassign+derefonce.litmus (moved to tools/memory-model/litmus-tests/)
> + Demonstrates that rcu_assign_pointer() and rcu_dereference() to
> + ensure that an RCU reader will not see pre-initialization garbage.

The grammar in this sentence is awful. Should the first "that" be
changed to "the use of"?

Alan

2020-05-12 14:21:47

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Tue, May 12, 2020 at 08:19:36AM -0400, Joel Fernandes wrote:
> On Tue, May 12, 2020 at 08:50:45PM +0900, Akira Yokosawa wrote:
> [...]
> > > I think on top of this patch, I'd like to add a reference to the to the
> > > litmus test in tools/memory-model/ from Documentation/rcu/.
> >
> > Sounds reasonable to me. But for most people, it never changes its location.
> > Please find inline comments below.
> >
> > >
> > > Just to mention my rationale for Documentation/litmus-tests/rcu/, I was
> > > basically looking for a central place for RCU related litmus tests in the
> > > kernel sources and the idea of this new directory came up.
> > >
> > > For Akira's series,
> > > Acked-by: Joel Fernandes (Google) <[email protected]>
> >
> > Thank you!
> >
> > >
> > > And could we add the following patch on top of Akira's series so we still
> > > maintain a reference to the moved RCU test?>
> > > ---8<-----------------------
> > >
> > > From 52fdb57551cc769d8bd690f4f2b22de36ddece99 Mon Sep 17 00:00:00 2001
> > > From: "Joel Fernandes (Google)" <[email protected]>
> > > Date: Mon, 11 May 2020 22:06:46 -0400
> > > Subject: [PATCH] docs: litmus-tests: Clarify about the RCU pre-initialization
> > > test
> > >
> > > Since this test was moved to tools/memory-model/, make sure that it is
> > > at least referenced from Documentation/litmus-tests/'s README.
> > >
> > > Signed-off-by: Joel Fernandes (Google) <[email protected]>
> > > ---
> > > Documentation/litmus-tests/README | 6 ++++--
> > > 1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> > > index ac0b270b456c1..53f09e74734a4 100644
> > > --- a/Documentation/litmus-tests/README
> > > +++ b/Documentation/litmus-tests/README
> > > @@ -11,7 +11,6 @@ tools/memory-model/README.
> > >
> > > atomic (/atomic derectory)
> > > --------------------------
> > > -
> > > Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
> > > Test that an atomic RMW followed by a smp_mb__after_atomic() is
> > > stronger than a normal acquire: both the read and write parts of
> > > @@ -23,8 +22,11 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
> > >
> > > RCU (/rcu directory)
> > > --------------------
> > > -
> >
> > I loosely followed the convention of ReST documents in putting these empty
> > lines. But I don't mind if they are removed.
> >
> > > RCU+sync+read.litmus
> > > RCU+sync+free.litmus
> > > Both the above litmus tests demonstrate the RCU grace period guarantee
> > > that an RCU read-side critical section can never span a grace period.
> > > +
> > > +MP+onceassign+derefonce.litmus (moved to tools/memory-model/litmus-tests/)
> >
> > As I said above, for those who don't follow developments in the lkmm branch,
> > MP+onceassign+derefonce.litmus stays in tools/memory-model/litmus-tests/.
> > So,
> >
> > +MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
> >
> > looks better to me.
>
> Yes it stays under tools/.. but is referenced here. Sounds like you agree and
> the only change from my follow-up patch that you want is to change "moved to"
> to "under".
>
> If so, Paul do you mind applying my patch and fixing this up? Or do you want
> to apply Akira's 3-patch series first and then have me send you another one
> on top?

Let's get something that you, Akira, and Alan are good with, then I will
apply that, either on top of or in place of the current commits (just
tell me which).

Thanx, Paul

2020-05-12 14:41:25

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Tue, 12 May 2020 07:19:44 -0700, Paul E. McKenney wrote:
> On Tue, May 12, 2020 at 08:19:36AM -0400, Joel Fernandes wrote:
>> On Tue, May 12, 2020 at 08:50:45PM +0900, Akira Yokosawa wrote:
>> [...]
>>>> I think on top of this patch, I'd like to add a reference to the to the
>>>> litmus test in tools/memory-model/ from Documentation/rcu/.
>>>
>>> Sounds reasonable to me. But for most people, it never changes its location.
>>> Please find inline comments below.
>>>
>>>>
>>>> Just to mention my rationale for Documentation/litmus-tests/rcu/, I was
>>>> basically looking for a central place for RCU related litmus tests in the
>>>> kernel sources and the idea of this new directory came up.
>>>>
>>>> For Akira's series,
>>>> Acked-by: Joel Fernandes (Google) <[email protected]>
>>>
>>> Thank you!
>>>
>>>>
>>>> And could we add the following patch on top of Akira's series so we still
>>>> maintain a reference to the moved RCU test?>
>>>> ---8<-----------------------
>>>>
>>>> From 52fdb57551cc769d8bd690f4f2b22de36ddece99 Mon Sep 17 00:00:00 2001
>>>> From: "Joel Fernandes (Google)" <[email protected]>
>>>> Date: Mon, 11 May 2020 22:06:46 -0400
>>>> Subject: [PATCH] docs: litmus-tests: Clarify about the RCU pre-initialization
>>>> test
>>>>
>>>> Since this test was moved to tools/memory-model/, make sure that it is
>>>> at least referenced from Documentation/litmus-tests/'s README.
>>>>
>>>> Signed-off-by: Joel Fernandes (Google) <[email protected]>
>>>> ---
>>>> Documentation/litmus-tests/README | 6 ++++--
>>>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
>>>> index ac0b270b456c1..53f09e74734a4 100644
>>>> --- a/Documentation/litmus-tests/README
>>>> +++ b/Documentation/litmus-tests/README
>>>> @@ -11,7 +11,6 @@ tools/memory-model/README.
>>>>
>>>> atomic (/atomic derectory)
>>>> --------------------------
>>>> -
>>>> Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
>>>> Test that an atomic RMW followed by a smp_mb__after_atomic() is
>>>> stronger than a normal acquire: both the read and write parts of
>>>> @@ -23,8 +22,11 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
>>>>
>>>> RCU (/rcu directory)
>>>> --------------------
>>>> -
>>>
>>> I loosely followed the convention of ReST documents in putting these empty
>>> lines. But I don't mind if they are removed.
>>>
>>>> RCU+sync+read.litmus
>>>> RCU+sync+free.litmus
>>>> Both the above litmus tests demonstrate the RCU grace period guarantee
>>>> that an RCU read-side critical section can never span a grace period.
>>>> +
>>>> +MP+onceassign+derefonce.litmus (moved to tools/memory-model/litmus-tests/)
>>>
>>> As I said above, for those who don't follow developments in the lkmm branch,
>>> MP+onceassign+derefonce.litmus stays in tools/memory-model/litmus-tests/.
>>> So,
>>>
>>> +MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
>>>
>>> looks better to me.
>>
>> Yes it stays under tools/.. but is referenced here. Sounds like you agree and
>> the only change from my follow-up patch that you want is to change "moved to"
>> to "under".
>>
>> If so, Paul do you mind applying my patch and fixing this up? Or do you want
>> to apply Akira's 3-patch series first and then have me send you another one
>> on top?
>
> Let's get something that you, Akira, and Alan are good with, then I will
> apply that, either on top of or in place of the current commits (just
> tell me which).

OK.
I'm submitting a patch [4/3] with Alan's suggested-by and Joel's and my
co-developed-by tags.
The explanation under tools/memory-model/litmus-tests/README also need the same
rewording.

Thanks, Akira

>
> Thanx, Paul
>

2020-05-12 15:12:05

by Akira Yokosawa

[permalink] [raw]
Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

From 7bb979aacd8788d174df8a56e9803ba9e5b7a381 Mon Sep 17 00:00:00 2001
From: Joel Fernandes (Google) <[email protected]>
Date: Mon, 11 May 2020 22:06:46 -0400
Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

Since this test returned to tools/memory-model/, make sure that it is
at least referenced from Documentation/litmus-tests/'s README.

Co-developed-by: Joel Fernandes (Google) <[email protected]>
Co-developed-by: Akira Yokosawa <[email protected]>
[Alan: grammar nit]
Suggested-by: Alan Stern <[email protected]>
Signed-off-by: Joel Fernandes (Google) <[email protected]>
Signed-off-by: Akira Yokosawa <[email protected]>
---
I said in the earlier message:

> The explanation under tools/memory-model/litmus-tests/README also need the same
> rewording.

, but obviously I was confused. It is good as is.

This is on top of my earlier patch series.

Joel, Alan, does this work with you?

Thanks, Akira
--
Documentation/litmus-tests/README | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
index ac0b270b456c..b79e640214b9 100644
--- a/Documentation/litmus-tests/README
+++ b/Documentation/litmus-tests/README
@@ -24,6 +24,10 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
RCU (/rcu directory)
--------------------

+MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
+ Demonstrates the use of rcu_assign_pointer() and rcu_dereference() to
+ ensure that an RCU reader will not see pre-initialization garbage.
+
RCU+sync+read.litmus
RCU+sync+free.litmus
Both the above litmus tests demonstrate the RCU grace period guarantee
--
2.17.1


2020-05-12 15:27:37

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

On Wed, 13 May 2020, Akira Yokosawa wrote:

> From 7bb979aacd8788d174df8a56e9803ba9e5b7a381 Mon Sep 17 00:00:00 2001
> From: Joel Fernandes (Google) <[email protected]>
> Date: Mon, 11 May 2020 22:06:46 -0400
> Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test
>
> Since this test returned to tools/memory-model/, make sure that it is
> at least referenced from Documentation/litmus-tests/'s README.
>
> Co-developed-by: Joel Fernandes (Google) <[email protected]>
> Co-developed-by: Akira Yokosawa <[email protected]>
> [Alan: grammar nit]
> Suggested-by: Alan Stern <[email protected]>
> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> Signed-off-by: Akira Yokosawa <[email protected]>
> ---
> I said in the earlier message:
>
> > The explanation under tools/memory-model/litmus-tests/README also need the same
> > rewording.
>
> , but obviously I was confused. It is good as is.
>
> This is on top of my earlier patch series.
>
> Joel, Alan, does this work with you?
>
> Thanks, Akira
> --
> Documentation/litmus-tests/README | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> index ac0b270b456c..b79e640214b9 100644
> --- a/Documentation/litmus-tests/README
> +++ b/Documentation/litmus-tests/README
> @@ -24,6 +24,10 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
> RCU (/rcu directory)
> --------------------
>
> +MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
> + Demonstrates the use of rcu_assign_pointer() and rcu_dereference() to
> + ensure that an RCU reader will not see pre-initialization garbage.
> +
> RCU+sync+read.litmus
> RCU+sync+free.litmus
> Both the above litmus tests demonstrate the RCU grace period guarantee

That's fine with me.

Alan

2020-05-12 15:42:32

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH 0/3] tools/memory-model, Documentation/litmus-test: Sort out location of litmus test and README

On Tue, May 12, 2020 at 10:39 AM Akira Yokosawa <[email protected]> wrote:
>
> On Tue, 12 May 2020 07:19:44 -0700, Paul E. McKenney wrote:
> > On Tue, May 12, 2020 at 08:19:36AM -0400, Joel Fernandes wrote:
> >> On Tue, May 12, 2020 at 08:50:45PM +0900, Akira Yokosawa wrote:
> >> [...]
> >>>> I think on top of this patch, I'd like to add a reference to the to the
> >>>> litmus test in tools/memory-model/ from Documentation/rcu/.
> >>>
> >>> Sounds reasonable to me. But for most people, it never changes its location.
> >>> Please find inline comments below.
> >>>
> >>>>
> >>>> Just to mention my rationale for Documentation/litmus-tests/rcu/, I was
> >>>> basically looking for a central place for RCU related litmus tests in the
> >>>> kernel sources and the idea of this new directory came up.
> >>>>
> >>>> For Akira's series,
> >>>> Acked-by: Joel Fernandes (Google) <[email protected]>
> >>>
> >>> Thank you!
> >>>
> >>>>
> >>>> And could we add the following patch on top of Akira's series so we still
> >>>> maintain a reference to the moved RCU test?>
> >>>> ---8<-----------------------
> >>>>
> >>>> From 52fdb57551cc769d8bd690f4f2b22de36ddece99 Mon Sep 17 00:00:00 2001
> >>>> From: "Joel Fernandes (Google)" <[email protected]>
> >>>> Date: Mon, 11 May 2020 22:06:46 -0400
> >>>> Subject: [PATCH] docs: litmus-tests: Clarify about the RCU pre-initialization
> >>>> test
> >>>>
> >>>> Since this test was moved to tools/memory-model/, make sure that it is
> >>>> at least referenced from Documentation/litmus-tests/'s README.
> >>>>
> >>>> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> >>>> ---
> >>>> Documentation/litmus-tests/README | 6 ++++--
> >>>> 1 file changed, 4 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> >>>> index ac0b270b456c1..53f09e74734a4 100644
> >>>> --- a/Documentation/litmus-tests/README
> >>>> +++ b/Documentation/litmus-tests/README
> >>>> @@ -11,7 +11,6 @@ tools/memory-model/README.
> >>>>
> >>>> atomic (/atomic derectory)
> >>>> --------------------------
> >>>> -
> >>>> Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus
> >>>> Test that an atomic RMW followed by a smp_mb__after_atomic() is
> >>>> stronger than a normal acquire: both the read and write parts of
> >>>> @@ -23,8 +22,11 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
> >>>>
> >>>> RCU (/rcu directory)
> >>>> --------------------
> >>>> -
> >>>
> >>> I loosely followed the convention of ReST documents in putting these empty
> >>> lines. But I don't mind if they are removed.
> >>>
> >>>> RCU+sync+read.litmus
> >>>> RCU+sync+free.litmus
> >>>> Both the above litmus tests demonstrate the RCU grace period guarantee
> >>>> that an RCU read-side critical section can never span a grace period.
> >>>> +
> >>>> +MP+onceassign+derefonce.litmus (moved to tools/memory-model/litmus-tests/)
> >>>
> >>> As I said above, for those who don't follow developments in the lkmm branch,
> >>> MP+onceassign+derefonce.litmus stays in tools/memory-model/litmus-tests/.
> >>> So,
> >>>
> >>> +MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
> >>>
> >>> looks better to me.
> >>
> >> Yes it stays under tools/.. but is referenced here. Sounds like you agree and
> >> the only change from my follow-up patch that you want is to change "moved to"
> >> to "under".
> >>
> >> If so, Paul do you mind applying my patch and fixing this up? Or do you want
> >> to apply Akira's 3-patch series first and then have me send you another one
> >> on top?
> >
> > Let's get something that you, Akira, and Alan are good with, then I will
> > apply that, either on top of or in place of the current commits (just
> > tell me which).
>
> OK.
> I'm submitting a patch [4/3] with Alan's suggested-by and Joel's and my
> co-developed-by tags.
> The explanation under tools/memory-model/litmus-tests/README also need the same
> rewording.

Sounds good to me, thanks!!

- Joel

2020-05-12 15:43:27

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

On Tue, May 12, 2020 at 11:07 AM Akira Yokosawa <[email protected]> wrote:
>
> From 7bb979aacd8788d174df8a56e9803ba9e5b7a381 Mon Sep 17 00:00:00 2001
> From: Joel Fernandes (Google) <[email protected]>
> Date: Mon, 11 May 2020 22:06:46 -0400
> Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test
>
> Since this test returned to tools/memory-model/, make sure that it is
> at least referenced from Documentation/litmus-tests/'s README.
>
> Co-developed-by: Joel Fernandes (Google) <[email protected]>
> Co-developed-by: Akira Yokosawa <[email protected]>
> [Alan: grammar nit]
> Suggested-by: Alan Stern <[email protected]>
> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> Signed-off-by: Akira Yokosawa <[email protected]>
> ---
> I said in the earlier message:
>
> > The explanation under tools/memory-model/litmus-tests/README also need the same
> > rewording.
>
> , but obviously I was confused. It is good as is.
>
> This is on top of my earlier patch series.
>
> Joel, Alan, does this work with you?

Yes, thanks a lot for doing it. Paul are you Ok with it too?

thanks,

- Joel


>
> Thanks, Akira
> --
> Documentation/litmus-tests/README | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> index ac0b270b456c..b79e640214b9 100644
> --- a/Documentation/litmus-tests/README
> +++ b/Documentation/litmus-tests/README
> @@ -24,6 +24,10 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
> RCU (/rcu directory)
> --------------------
>
> +MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
> + Demonstrates the use of rcu_assign_pointer() and rcu_dereference() to
> + ensure that an RCU reader will not see pre-initialization garbage.
> +
> RCU+sync+read.litmus
> RCU+sync+free.litmus
> Both the above litmus tests demonstrate the RCU grace period guarantee
> --
> 2.17.1
>
>

2020-05-12 16:34:45

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

On Tue, May 12, 2020 at 11:41:01AM -0400, Joel Fernandes wrote:
> On Tue, May 12, 2020 at 11:07 AM Akira Yokosawa <[email protected]> wrote:
> >
> > From 7bb979aacd8788d174df8a56e9803ba9e5b7a381 Mon Sep 17 00:00:00 2001
> > From: Joel Fernandes (Google) <[email protected]>
> > Date: Mon, 11 May 2020 22:06:46 -0400
> > Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test
> >
> > Since this test returned to tools/memory-model/, make sure that it is
> > at least referenced from Documentation/litmus-tests/'s README.
> >
> > Co-developed-by: Joel Fernandes (Google) <[email protected]>
> > Co-developed-by: Akira Yokosawa <[email protected]>
> > [Alan: grammar nit]
> > Suggested-by: Alan Stern <[email protected]>
> > Signed-off-by: Joel Fernandes (Google) <[email protected]>
> > Signed-off-by: Akira Yokosawa <[email protected]>
> > ---
> > I said in the earlier message:
> >
> > > The explanation under tools/memory-model/litmus-tests/README also need the same
> > > rewording.
> >
> > , but obviously I was confused. It is good as is.
> >
> > This is on top of my earlier patch series.
> >
> > Joel, Alan, does this work with you?
>
> Yes, thanks a lot for doing it. Paul are you Ok with it too?

Looks good to me!

Could one of you please send a patch series and instructions, which I
-think- will be of the form:

o Revert a5cca3485d92 ("Documentation: LKMM: Move
MP+onceassign+derefonce to new litmus-tests/rcu/")

o Apply a series of patches.

(My head is deep within some ring-buffer code that I am reviewing, so I
guarantee that if I try to piece this together from the current set of
patches, I will end up producing a spectacular display of destructive
creativity.)

Thanx, Paul

> thanks,
>
> - Joel
>
>
> >
> > Thanks, Akira
> > --
> > Documentation/litmus-tests/README | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/litmus-tests/README b/Documentation/litmus-tests/README
> > index ac0b270b456c..b79e640214b9 100644
> > --- a/Documentation/litmus-tests/README
> > +++ b/Documentation/litmus-tests/README
> > @@ -24,6 +24,10 @@ Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus
> > RCU (/rcu directory)
> > --------------------
> >
> > +MP+onceassign+derefonce.litmus (under tools/memory-model/litmus-tests/)
> > + Demonstrates the use of rcu_assign_pointer() and rcu_dereference() to
> > + ensure that an RCU reader will not see pre-initialization garbage.
> > +
> > RCU+sync+read.litmus
> > RCU+sync+free.litmus
> > Both the above litmus tests demonstrate the RCU grace period guarantee
> > --
> > 2.17.1
> >
> >

2020-05-12 21:46:01

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

On Tue, May 12, 2020 at 09:30:22AM -0700, Paul E. McKenney wrote:
> On Tue, May 12, 2020 at 11:41:01AM -0400, Joel Fernandes wrote:
> > On Tue, May 12, 2020 at 11:07 AM Akira Yokosawa <[email protected]> wrote:
> > >
> > > From 7bb979aacd8788d174df8a56e9803ba9e5b7a381 Mon Sep 17 00:00:00 2001
> > > From: Joel Fernandes (Google) <[email protected]>
> > > Date: Mon, 11 May 2020 22:06:46 -0400
> > > Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test
> > >
> > > Since this test returned to tools/memory-model/, make sure that it is
> > > at least referenced from Documentation/litmus-tests/'s README.
> > >
> > > Co-developed-by: Joel Fernandes (Google) <[email protected]>
> > > Co-developed-by: Akira Yokosawa <[email protected]>
> > > [Alan: grammar nit]
> > > Suggested-by: Alan Stern <[email protected]>
> > > Signed-off-by: Joel Fernandes (Google) <[email protected]>
> > > Signed-off-by: Akira Yokosawa <[email protected]>
> > > ---
> > > I said in the earlier message:
> > >
> > > > The explanation under tools/memory-model/litmus-tests/README also need the same
> > > > rewording.
> > >
> > > , but obviously I was confused. It is good as is.
> > >
> > > This is on top of my earlier patch series.
> > >
> > > Joel, Alan, does this work with you?
> >
> > Yes, thanks a lot for doing it. Paul are you Ok with it too?
>
> Looks good to me!
>
> Could one of you please send a patch series and instructions, which I
> -think- will be of the form:
>
> o Revert a5cca3485d92 ("Documentation: LKMM: Move
> MP+onceassign+derefonce to new litmus-tests/rcu/")
>
> o Apply a series of patches.

Rebased Akira's 3 and my 1 on top of your /dev branch with the ordering done as above:

Could you pull?

git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (branch for-paul-dev)

Thanks!

- Joel

2020-05-12 21:51:46

by Akira Yokosawa

[permalink] [raw]
Subject: Re: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

On Tue, 12 May 2020 17:43:42 -0400, Joel Fernandes wrote:
> On Tue, May 12, 2020 at 09:30:22AM -0700, Paul E. McKenney wrote:
>> On Tue, May 12, 2020 at 11:41:01AM -0400, Joel Fernandes wrote:
>>> On Tue, May 12, 2020 at 11:07 AM Akira Yokosawa <[email protected]> wrote:
>>>>
>>>> From 7bb979aacd8788d174df8a56e9803ba9e5b7a381 Mon Sep 17 00:00:00 2001
>>>> From: Joel Fernandes (Google) <[email protected]>
>>>> Date: Mon, 11 May 2020 22:06:46 -0400
>>>> Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test
>>>>
>>>> Since this test returned to tools/memory-model/, make sure that it is
>>>> at least referenced from Documentation/litmus-tests/'s README.
>>>>
>>>> Co-developed-by: Joel Fernandes (Google) <[email protected]>
>>>> Co-developed-by: Akira Yokosawa <[email protected]>
>>>> [Alan: grammar nit]
>>>> Suggested-by: Alan Stern <[email protected]>
>>>> Signed-off-by: Joel Fernandes (Google) <[email protected]>
>>>> Signed-off-by: Akira Yokosawa <[email protected]>
>>>> ---
>>>> I said in the earlier message:
>>>>
>>>>> The explanation under tools/memory-model/litmus-tests/README also need the same
>>>>> rewording.
>>>>
>>>> , but obviously I was confused. It is good as is.
>>>>
>>>> This is on top of my earlier patch series.
>>>>
>>>> Joel, Alan, does this work with you?
>>>
>>> Yes, thanks a lot for doing it. Paul are you Ok with it too?
>>
>> Looks good to me!
>>
>> Could one of you please send a patch series and instructions, which I
>> -think- will be of the form:
>>
>> o Revert a5cca3485d92 ("Documentation: LKMM: Move
>> MP+onceassign+derefonce to new litmus-tests/rcu/")
>>
>> o Apply a series of patches.
>
> Rebased Akira's 3 and my 1 on top of your /dev branch with the ordering done as above:

Oh, I missed the reordering part in my PATCH RESEND series.

Paul, it's up to you which you pull/apply.

Thanks, Akira

>
> Could you pull?
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (branch for-paul-dev)
>
> Thanks!
>
> - Joel
>

2020-05-12 22:56:09

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test

On Tue, May 12, 2020 at 5:49 PM Akira Yokosawa <[email protected]> wrote:
>
> On Tue, 12 May 2020 17:43:42 -0400, Joel Fernandes wrote:
> > On Tue, May 12, 2020 at 09:30:22AM -0700, Paul E. McKenney wrote:
> >> On Tue, May 12, 2020 at 11:41:01AM -0400, Joel Fernandes wrote:
> >>> On Tue, May 12, 2020 at 11:07 AM Akira Yokosawa <[email protected]> wrote:
> >>>>
> >>>> From 7bb979aacd8788d174df8a56e9803ba9e5b7a381 Mon Sep 17 00:00:00 2001
> >>>> From: Joel Fernandes (Google) <[email protected]>
> >>>> Date: Mon, 11 May 2020 22:06:46 -0400
> >>>> Subject: [PATCH 4/3] docs: litmus-tests: Clarify about the RCU pre-initialization test
> >>>>
> >>>> Since this test returned to tools/memory-model/, make sure that it is
> >>>> at least referenced from Documentation/litmus-tests/'s README.
> >>>>
> >>>> Co-developed-by: Joel Fernandes (Google) <[email protected]>
> >>>> Co-developed-by: Akira Yokosawa <[email protected]>
> >>>> [Alan: grammar nit]
> >>>> Suggested-by: Alan Stern <[email protected]>
> >>>> Signed-off-by: Joel Fernandes (Google) <[email protected]>
> >>>> Signed-off-by: Akira Yokosawa <[email protected]>
> >>>> ---
> >>>> I said in the earlier message:
> >>>>
> >>>>> The explanation under tools/memory-model/litmus-tests/README also need the same
> >>>>> rewording.
> >>>>
> >>>> , but obviously I was confused. It is good as is.
> >>>>
> >>>> This is on top of my earlier patch series.
> >>>>
> >>>> Joel, Alan, does this work with you?
> >>>
> >>> Yes, thanks a lot for doing it. Paul are you Ok with it too?
> >>
> >> Looks good to me!
> >>
> >> Could one of you please send a patch series and instructions, which I
> >> -think- will be of the form:
> >>
> >> o Revert a5cca3485d92 ("Documentation: LKMM: Move
> >> MP+onceassign+derefonce to new litmus-tests/rcu/")
> >>
> >> o Apply a series of patches.
> >
> > Rebased Akira's 3 and my 1 on top of your /dev branch with the ordering done as above:
>
> Oh, I missed the reordering part in my PATCH RESEND series.
>

That's Ok, I took care of it ;-) You passed me the ball, I hit it into the goal.

> Paul, it's up to you which you pull/apply.

Indeed! ;-)

- Joel


>
> Thanks, Akira
>
> >
> > Could you pull?
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (branch for-paul-dev)
> >
> > Thanks!
> >
> > - Joel
> >