From: Ingo Molnar <mingo@kernel.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
stern@rowland.harvard.edu, parri.andrea@gmail.com,
j.alglave@ucl.ac.uk, luc.maranget@inria.fr, boqun.feng@gmail.com,
will.deacon@arm.com, peterz@infradead.org, npiggin@gmail.com,
dhowells@redhat.com, elena.reshetova@intel.com, mhocko@suse.com,
akiyks@gmail.com, Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [GIT PULL tools] Linux kernel memory model
Date: Wed, 31 Jan 2018 10:00:06 +0100 [thread overview]
Message-ID: <20180131090006.onaopgyqthppoysi@gmail.com> (raw)
In-Reply-To: <20180129095449.GT3741@linux.vnet.ibm.com>
* Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> On Mon, Jan 29, 2018 at 07:57:24AM +0100, Ingo Molnar wrote:
> >
> > hi Paul,
> >
> > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> >
> > > Hello, Ingo,
> > >
> > > This pull request contains a single commit that adds a memory model to
> > > the tools directory. This memory model can (roughly speaking) be thought
> > > of as an automated version of memory-barriers.txt. It is written in the
> > > "cat" language, which is executable by the externally provided "herd7"
> > > simulator, which exhaustively explores the state space of small litmus
> > > tests.
> > >
> > > This memory model is accompanied by extensive documentation on its use
> > > and its design. Two versions have been sent to LKML and feedback
> > > incorporated:
> > >
> > > 1. http://lkml.kernel.org/r/20171113184031.GA26302@linux.vnet.ibm.com
> > > 2. http://lkml.kernel.org/r/20180119035855.GA29296@linux.vnet.ibm.com
> > >
> > > This model has been presented and demoed at a number of Linux gatherings,
> > > including the 2016 LinuxCon EU, the 2016 Linux Plumbers Conference,
> > > the 2016 Linux Kernel Summit, the 2017 linux.conf.au, and the 2017 Linux
> > > Plumbers Conference, which featured a workshop helping a number of Linux
> > > kernel hackers install and use the tool.
> > >
> > > This memory model has matured to the point where it would be good to include
> > > it in the Linux kernel, for example, to allow it to track changes as new
> > > hardware and use cases are added. We expect the rate of change to be similar
> > > to that of Documentation/memory-barriers.txt.
> > >
> > > This memory model is available in the git repository at:
> > >
> > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > >
> > > for you to fetch changes up to 1c27b644c0fdbc61e113b8faee14baeb8df32486:
> > >
> > > Automate memory-barriers.txt; provide Linux-kernel memory model (2018-01-24 20:53:49 -0800)
> >
> > Looks good to me, but the commit is not in the master branch of your tree, which
> > branch should I pull?
>
> Oops!!! The branch is lkmm-for-mingo.
>
> Please accept my apologies for the implicit maintainer treasure hunt!
No problem, was able to pull it!
I really like this formal description of of the Linux kernel memory coherency
model and the extensive documentation around it. Clearly a lot of effort went
into this work!
A couple of questions:
- Would it be possible to include all the nice descriptions of the litmus tests in
the tests themselves? Right now it's a bit weird that most of them come with
zero explanations, but the tools/memory-model/litmus-tests/README lists most of
them.
- Similary, some of the high level descriptions in tools/memory-model/README
should probably propagated into the source code files as well: for example
both tools/memory-model/lock.cat and linux-kernel.cat could be improved that
way.
- Could tools/memory-model/MAINTAINERS be added to the main Linux MAINTAINERS file
as well, like we do for other bits of tooling?
- There's no description about why the .bell file is called 'bell' and what
language/syntax it is in - I had to search around to figure out that it's a
"Bell extension" to .cat files. This aspect IMHO isn't really obvious to first
time readers so a bit more explanation would be nice.
- A high level question: have you considered calling it the "Linux kernel memory
coherency model", instead of the "Linux memory model"? Another naming would be
the "Linux kernel memory access model" as memory-barriers.txt calls it.
The "memory model" name is overly generic, ambiguous and somewhat misleading,
as we usually mean the virtual memory layout/model when we say "memory model".
GCC too uses it in that sense: 'small memory model' and 'large memory model' -
which too is about VM layout, not multiprocessing coherency.
- A long term question: have you considered and would it make sense to generate a
memory-barriers.txt like file directly into Documentation/locking/, using the
formal description? That way any changes/extensions/fixes to the model could be
tracked on a high level, without readers having to understand the formal
representation.
In any case, the base commit is certainly nice and clean and I've pulled it into
tip:locking/core for a v4.17 merge.
I believe these additional improvements (to the extent you agree with doing them!)
could/should be done as add-on commits on top of this existing commit.
Thanks,
Ingo
next prev parent reply other threads:[~2018-01-31 9:00 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 9:34 [GIT PULL tools] Linux kernel memory model Paul E. McKenney
2018-01-25 9:34 ` Paul E. McKenney
2018-01-29 6:57 ` Ingo Molnar
2018-01-29 9:54 ` Paul E. McKenney
2018-01-31 9:00 ` Ingo Molnar [this message]
2018-01-31 10:08 ` Peter Zijlstra
2018-01-31 10:08 ` Peter Zijlstra
2018-01-31 23:53 ` Paul E. McKenney
2018-01-31 23:53 ` Paul E. McKenney
2018-02-01 1:17 ` Paul E. McKenney
2018-02-01 6:57 ` Ingo Molnar
2018-02-01 23:14 ` Paul E. McKenney
2018-02-01 23:14 ` Paul E. McKenney
2018-02-02 4:46 ` Boqun Feng
2018-02-02 5:40 ` Paul E. McKenney
2018-02-03 8:48 ` Paul E. McKenney
2018-02-03 22:10 ` Alan Stern
2018-02-04 9:16 ` Paul E. McKenney
2018-02-04 10:17 ` Paul E. McKenney
2018-02-04 16:29 ` Andrea Parri
2018-02-05 5:00 ` Paul E. McKenney
2018-02-04 16:37 ` Alan Stern
2018-02-05 7:19 ` Paul E. McKenney
2018-02-08 18:41 ` Patrick Bellasi
2018-02-08 20:02 ` Peter Zijlstra
2018-02-08 20:02 ` Peter Zijlstra
2018-02-09 9:11 ` Andrea Parri
2018-02-09 9:11 ` Andrea Parri
2018-02-09 11:29 ` Paul E. McKenney
2018-02-09 12:41 ` Andrea Parri
2018-02-09 12:41 ` Andrea Parri
2018-02-09 12:56 ` Paul E. McKenney
2018-02-09 12:56 ` Paul E. McKenney
2018-02-09 11:33 ` Paul E. McKenney
2018-02-09 11:33 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180131090006.onaopgyqthppoysi@gmail.com \
--to=mingo@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akiyks@gmail.com \
--cc=boqun.feng@gmail.com \
--cc=dhowells@redhat.com \
--cc=elena.reshetova@intel.com \
--cc=j.alglave@ucl.ac.uk \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luc.maranget@inria.fr \
--cc=mhocko@suse.com \
--cc=npiggin@gmail.com \
--cc=parri.andrea@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=stern@rowland.harvard.edu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).