Skip to content

RFC memory model: Make unlock(A)+lock(B) on the same CPU RCtso

Boqun Feng linux-arch linux-doc lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest3 patches 6 repliesIn review
  2. v11 patch 11 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPUtools/memory-model/Documentation/explanation.txt tools/memory-model/linux-kernel.cat+28 -220 replies
2/3tools/memory-model: doc: Describe the requirement of the litmus-tests directorytools/memory-model/README+12 -00 replies
3/3tools/memory-model: litmus: Add two tests for unlock(A)+lock(B) orderingtools/memory-model/litmus-tests/LB+unlocklockonceonce+poacquireonce.litmus tools/memory-model/litmus-tests/MP+unlocklockonceonce+fencermbonceonce.litmus tools/memory-model/litmus-tests/README+74 -05 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMichael EllermanPalmer DabbeltPeter Zijlstra (Intel)
SeriesA-b
1/3R-b A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [RFC v2 0/3] memory model: Make unlock(A)+lock(B) on the same CPU RCtso

Hi,

Just a new version trying to make forward progress on this ;-)

v1: https://lore.kernel.org/lkml/[email protected]/

Changes since v1:

* Split the patch into three to help resolve the litmus test
addition discussion.
* Add some explanation in patch #2 on the requirement of tests in
litmus-tests directory.

To summarize the change in memory model, we now guarantee in the following code:

	<memory access M>
	spin_unlock(A);
	spin_lock(B);
	<memory access N>

M is ordered against N unless M is a store and N is a load. More detailed examples of this guarantee can be found in patch #3.

Architecture maintainers, appreciate it that you can take a look at patch #3 and rest of whole set to confirm this guarantee works on your architectures.

Alan, I split the patchset into three patches because I do think we need some sort of patch #2 so that we can have consensus about whether merge patch #3 or not. I know you want to keep litmus-tests directory as simple as possible, but it won't hurt to document the requirement. Looking forwards to your thoughts ;-)

Suggestion and comments are welcome!

Regards,
Boqun

Boqun Feng (3):
tools/memory-model: Provide extra ordering for unlock+lock pair on the
same CPU
tools/memory-model: doc: Describe the requirement of the litmus-tests
directory
tools/memory-model: litmus: Add two tests for unlock(A)+lock(B)
ordering

 .../Documentation/explanation.txt             | 44 +++++++++++--------
 tools/memory-model/README                     | 12 +++++
 tools/memory-model/linux-kernel.cat           |  6 +--
 ...LB+unlocklockonceonce+poacquireonce.litmus | 33 ++++++++++++++
 ...unlocklockonceonce+fencermbonceonce.litmus | 33 ++++++++++++++
 tools/memory-model/litmus-tests/README        |  8 ++++
 6 files changed, 114 insertions(+), 22 deletions(-)
 create mode 100644 tools/memory-model/litmus-tests/LB+unlocklockonceonce+poacquireonce.litmus
 create mode 100644 tools/memory-model/litmus-tests/MP+unlocklockonceonce+fencermbonceonce.litmus
Signature · 1 line
2.33.0