<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/memory-model, branch v5.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-08-09T17:28:57Z</updated>
<entry>
<title>tools/memory-model: Update the informal documentation</title>
<updated>2019-08-09T17:28:57Z</updated>
<author>
<name>Andrea Parri</name>
<email>andrea.parri@amarulasolutions.com</email>
</author>
<published>2019-06-29T21:10:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6738ff85c3ee8073d5b030cb26241d0009d4ce29'/>
<id>urn:sha1:6738ff85c3ee8073d5b030cb26241d0009d4ce29</id>
<content type='text'>
The formal memory consistency model has added support for plain accesses
(and data races).  While updating the informal documentation to describe
this addition to the model is highly desirable and important future work,
update the informal documentation to at least acknowledge such addition.

Signed-off-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Jade Alglave &lt;j.alglave@ucl.ac.uk&gt;
Cc: Luc Maranget &lt;luc.maranget@inria.fr&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.ibm.com&gt;
Cc: Akira Yokosawa &lt;akiyks@gmail.com&gt;
Cc: Daniel Lustig &lt;dlustig@nvidia.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Use cumul-fence instead of fence in -&gt;prop example</title>
<updated>2019-08-09T17:28:57Z</updated>
<author>
<name>Joel Fernandes (Google)</name>
<email>joel@joelfernandes.org</email>
</author>
<published>2019-07-29T12:36:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6240973e5661a83df24e35a9a9c2013496931e2b'/>
<id>urn:sha1:6240973e5661a83df24e35a9a9c2013496931e2b</id>
<content type='text'>
To reduce ambiguity in the more exotic -&gt;prop ordering example, this
commit uses the term cumul-fence instead of the term fence for the two
fences, so that the implict -&gt;rfe on loads/stores to Y are covered by
the description.

Link: https://lore.kernel.org/lkml/20190729121745.GA140682@google.com

Suggested-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Make scripts be executable</title>
<updated>2019-08-01T15:40:07Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-02-11T20:13:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7455cdd1a0fe9a1367ee99596ea2564031daec00'/>
<id>urn:sha1:7455cdd1a0fe9a1367ee99596ea2564031daec00</id>
<content type='text'>
This commit simplifies life a bit by making all of the scripts in
tools/memory-model/scripts be executable.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Improve data-race detection</title>
<updated>2019-06-24T16:08:54Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-06-20T15:55:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4289ee7d5a8343eaddd0986f8fb492868e2f546f'/>
<id>urn:sha1:4289ee7d5a8343eaddd0986f8fb492868e2f546f</id>
<content type='text'>
Herbert Xu recently reported a problem concerning RCU and compiler
barriers.  In the course of discussing the problem, he put forth a
litmus test which illustrated a serious defect in the Linux Kernel
Memory Model's data-race-detection code [1].

The defect was that the LKMM assumed visibility and executes-before
ordering of plain accesses had to be mediated by marked accesses.  In
Herbert's litmus test this wasn't so, and the LKMM claimed the litmus
test was allowed and contained a data race although neither is true.

In fact, plain accesses can be ordered by fences even in the absence
of marked accesses.  In most cases this doesn't matter, because most
fences only order accesses within a single thread.  But the rcu-fence
relation is different; it can order (and induce visibility between)
accesses in different threads -- events which otherwise might be
concurrent.  This makes it relevant to data-race detection.

This patch makes two changes to the memory model to incorporate the
new insight:

	If a store is separated by a fence from another access,
	the store is necessarily visible to the other access (as
	reflected in the ww-vis and wr-vis relations).  Similarly,
	if a load is separated by a fence from another access then
	the load necessarily executes before the other access (as
	reflected in the rw-xbstar relation).

	If a store is separated by a strong fence from a marked access
	then it is necessarily visible to any access that executes
	after the marked access (as reflected in the ww-vis and wr-vis
	relations).

With these changes, the LKMM gives the desired result for Herbert's
litmus test and other related ones [2].

[1]	https://lore.kernel.org/lkml/Pine.LNX.4.44L0.1906041026570.1731-100000@iolanthe.rowland.org/

[2]	https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-1.litmus
	https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-2.litmus
	https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-3.litmus
	https://github.com/paulmckrcu/litmus/blob/master/manual/plain/C-S-rcunoderef-4.litmus
	https://github.com/paulmckrcu/litmus/blob/master/manual/plain/strong-vis.litmus

Reported-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
Tested-by: Akira Yokosawa &lt;akiyks@gmail.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Change definition of rcu-fence</title>
<updated>2019-06-21T23:20:49Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-06-20T15:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=15aa25cbf0ccc4bd63ed6f2a8065decb7f5e6f89'/>
<id>urn:sha1:15aa25cbf0ccc4bd63ed6f2a8065decb7f5e6f89</id>
<content type='text'>
The rcu-fence relation in the Linux Kernel Memory Model is not well
named.  It doesn't act like any other fence relation, in that it does
not relate events before a fence to events after that fence.  All it
does is relate certain RCU events to one another (those that are
ordered by the RCU Guarantee); this induces an actual
strong-fence-like relation linking events preceding the first RCU
event to those following the second.

This patch renames rcu-fence, now called rcu-order.  It adds a new
definition of rcu-fence, something which should have been present all
along because it is used in the rb relation.  And it modifies the
fence and strong-fence relations by making them incorporate the new
rcu-fence.

As a result of this change, there is no longer any need to define
full-fence in the section for detecting data races.  It can simply be
replaced by the updated strong-fence relation.

This change should have no effect on the operation of the memory model.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Expand definition of barrier</title>
<updated>2019-06-21T23:18:45Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-06-20T15:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f9de417121001879d92a86960647adb06b5b81bf'/>
<id>urn:sha1:f9de417121001879d92a86960647adb06b5b81bf</id>
<content type='text'>
Commit 66be4e66a7f4 ("rcu: locking and unlocking need to always be at
least barriers") added compiler barriers back into rcu_read_lock() and
rcu_read_unlock().  Furthermore, srcu_read_lock() and
srcu_read_unlock() have always contained compiler barriers.

The Linux Kernel Memory Model ought to know about these barriers.
This patch adds them into the memory model.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Do not use "herd" to refer to "herd7"</title>
<updated>2019-06-19T16:32:10Z</updated>
<author>
<name>Andrea Parri</name>
<email>andrea.parri@amarulasolutions.com</email>
</author>
<published>2019-02-19T22:55:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=37c600a3cc8a6941d77e853ec4e0e33fffa1046b'/>
<id>urn:sha1:37c600a3cc8a6941d77e853ec4e0e33fffa1046b</id>
<content type='text'>
Use "herd7" in each such reference.

Signed-off-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Jade Alglave &lt;j.alglave@ucl.ac.uk&gt;
Cc: Luc Maranget &lt;luc.maranget@inria.fr&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.ibm.com&gt;
Cc: Akira Yokosawa &lt;akiyks@gmail.com&gt;
Cc: Daniel Lustig &lt;dlustig@nvidia.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Fix comment in MP+poonceonces.litmus</title>
<updated>2019-06-19T16:31:54Z</updated>
<author>
<name>Andrea Parri</name>
<email>andrea.parri@amarulasolutions.com</email>
</author>
<published>2019-02-19T22:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46f52b1fe79d2453467b904600ae4759808c4a44'/>
<id>urn:sha1:46f52b1fe79d2453467b904600ae4759808c4a44</id>
<content type='text'>
The comment should say "Sometimes" for the result.

Signed-off-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Jade Alglave &lt;j.alglave@ucl.ac.uk&gt;
Cc: Luc Maranget &lt;luc.maranget@inria.fr&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.ibm.com&gt;
Cc: Akira Yokosawa &lt;akiyks@gmail.com&gt;
Cc: Daniel Lustig &lt;dlustig@nvidia.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Add data-race detection</title>
<updated>2019-05-28T15:18:21Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-04-22T16:18:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0031e38adf38779acce5737f4905b9f60750b674'/>
<id>urn:sha1:0031e38adf38779acce5737f4905b9f60750b674</id>
<content type='text'>
This patch adds data-race detection to the Linux-Kernel Memory Model.
As part of this effort, support is added for:

	compiler barriers (the barrier() function), and

	a new Preserved Program Order term: (addr ; [Plain] ; wmb)

Data races are marked with a special Flag warning in herd.  It is
not guaranteed that the model will provide accurate predictions when a
data race is present.

The patch does not include documentation for the data-race detection
facility.  The basic design has been explained in various emails, and
a separate documentation patch will be submitted later.

This work is based on an earlier formulation of data races for the
LKMM by Andrea Parri.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reviewed-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>tools/memory-model: Add definitions of plain and marked accesses</title>
<updated>2019-05-28T15:18:21Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-04-22T16:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1a84ab190137cc2a980b6979b1f2790d51b2d87'/>
<id>urn:sha1:d1a84ab190137cc2a980b6979b1f2790d51b2d87</id>
<content type='text'>
This patch adds definitions for marked and plain accesses to the
Linux-Kernel Memory Model.  It also modifies the definitions of the
existing parts of the model (including the cumul-fence, prop, hb, pb,
and rb relations) so as to make them apply only to marked accesses.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reviewed-by: Andrea Parri &lt;andrea.parri@amarulasolutions.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
</feed>
