[PATCH] [TENTATIVE] Trial conflict resolution of Alan's patch

From: Alan Stern
Date: Thu Feb 15 2018 - 10:29:56 EST


This is a trial of conflict resolution of the patch Alan provided.

Alan's message and original patch:

Here's the relevant patch. It may need some manual adjustment, because
it was not made against the files currently in the repository.

Alan

diff --git a/linux-kernel-hardware.cat b/linux-kernel-hardware.cat
Index: memory-model/linux-kernel-hardware.cat
===================================================================
--- memory-model.orig/linux-kernel-hardware.cat
+++ memory-model/linux-kernel-hardware.cat
@@ -31,7 +31,7 @@ let strong-fence = mb | gp
(* Release Acquire *)
let acq-po = [Acquire] ; po ; [M]
let po-rel = [M] ; po ; [Release]
-let rfi-rel-acq = [Release] ; rfi ; [Acquire]
+let rel-rf-acq-po = [Release] ; rf ; [Acquire] ; po

(**********************************)
(* Fundamental coherence ordering *)
@@ -57,13 +57,13 @@ let to-w = rwdep | addrpo | (overwrite &
let rdw = po-loc & (fre ; rfe)
let detour = po-loc & (coe ; rfe)
let rrdep = addr | (dep ; rfi)
-let to-r = rrdep | rfi-rel-acq
-let fence = strong-fence | wmb | po-rel | rmb | acq-po
+let to-r = rrdep
+let fence = strong-fence | wmb | po-rel | rmb | acq-po | (rel-rf-acq-po & int)
let ppo = to-r | to-w | fence | rdw | detour

(* Happens Before *)
let A-cumul(r) = rfe? ; r
-let cumul-fence = A-cumul(strong-fence | po-rel) | wmb
+let cumul-fence = A-cumul(strong-fence | po-rel) | wmb | rel-rf-acq-po

let rec prop = (overwrite & ext)? ; cumul-fence ; hb*
and hb = ppo | rfe | ((hb* ; prop) & int)
Index: memory-model/linux-kernel.cat
===================================================================
--- memory-model.orig/linux-kernel.cat
+++ memory-model/linux-kernel.cat
@@ -31,7 +31,7 @@ let strong-fence = mb | gp
(* Release Acquire *)
let acq-po = [Acquire] ; po ; [M]
let po-rel = [M] ; po ; [Release]
-let rfi-rel-acq = [Release] ; rfi ; [Acquire]
+let rel-rf-acq-po = [Release] ; rf ; [Acquire] ; po

(**********************************)
(* Fundamental coherence ordering *)
@@ -54,13 +54,13 @@ let rwdep = (dep | ctrl) ; [W]
let overwrite = co | fr
let to-w = rwdep | (overwrite & int)
let rrdep = addr | (dep ; rfi)
-let to-r = rrdep | rfi-rel-acq
-let fence = strong-fence | wmb | po-rel | rmb | acq-po
+let to-r = rrdep
+let fence = strong-fence | wmb | po-rel | rmb | acq-po | (rel-rf-acq-po & int)
let ppo = to-r | to-w | fence

(* Propagation: Ordering from release operations and strong fences. *)
let A-cumul(r) = rfe? ; r
-let cumul-fence = A-cumul(strong-fence | po-rel) | wmb
+let cumul-fence = A-cumul(strong-fence | po-rel) | wmb | rel-rf-acq-po
let prop = (overwrite & ext)? ; cumul-fence* ; rfe?

(*

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
[akiyks: Rebased to current master]
Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
So, I attempted to rebase the patch to current (somewhat old) master of
https://github.com/aparri/memory-model. Why? Because the lkmm branch
in Paul's -rcu tree doesn't have linux-kernel-hardware.cat.

However, after this change, Z6.0+pooncelock+pooncelock+pombonce still
has the result "Sometimes". I must have done something wrong in the
conflict resolution.

Note: I have almost no idea what this patch is doing. I'm just hoping
to give a starting point of a discussion.

Thanks, Akira
--
linux-kernel-hardware.cat | 9 ++++-----
linux-kernel.cat | 9 ++++-----
2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/linux-kernel-hardware.cat b/linux-kernel-hardware.cat
index 7768bf7..6c35655 100644
--- a/linux-kernel-hardware.cat
+++ b/linux-kernel-hardware.cat
@@ -34,7 +34,7 @@ let strong-fence = mb | gp
(* Release Acquire *)
let acq-po = [Acquire] ; po ; [M]
let po-rel = [M] ; po ; [Release]
-let rfi-rel-acq = [Release] ; rfi ; [Acquire]
+let rel-rf-acq-po = [Release] ; rf ; [Acquire] ; po

(**********************************)
(* Fundamental coherence ordering *)
@@ -60,14 +60,13 @@ let to-w = rwdep | addrpo | (overwrite & int)
let rdw = po-loc & (fre ; rfe)
let detour = po-loc & (coe ; rfe)
let rrdep = addr | (dep ; rfi) | rdw
-let strong-rrdep = rrdep+ & rb-dep
-let to-r = strong-rrdep | rfi-rel-acq
-let fence = strong-fence | wmb | po-rel | rmb | acq-po
+let to-r = rrdep
+let fence = strong-fence | wmb | po-rel | rmb | acq-po | (rel-rf-acq-po & int)
let ppo = (rrdep* ; (to-r | to-w | fence)) | rdw | detour

(* Happens Before *)
let A-cumul(r) = rfe? ; r
-let cumul-fence = A-cumul(strong-fence | po-rel) | wmb
+let cumul-fence = A-cumul(strong-fence | po-rel) | wmb | rel-rf-acq-po

let rec prop = (overwrite & ext)? ; cumul-fence ; hb*
and hb = ppo | rfe | ((hb* ; prop) & int)
diff --git a/linux-kernel.cat b/linux-kernel.cat
index 15b7a5d..c6b0752 100644
--- a/linux-kernel.cat
+++ b/linux-kernel.cat
@@ -39,7 +39,7 @@ let strong-fence = mb | gp
(* Release Acquire *)
let acq-po = [Acquire] ; po ; [M]
let po-rel = [M] ; po ; [Release]
-let rfi-rel-acq = [Release] ; rfi ; [Acquire]
+let rel-rf-acq-po = [Release] ; rf ; [Acquire] ; po

(**********************************)
(* Fundamental coherence ordering *)
@@ -62,14 +62,13 @@ let rwdep = (dep | ctrl) ; [W]
let overwrite = co | fr
let to-w = rwdep | (overwrite & int)
let rrdep = addr | (dep ; rfi)
-let strong-rrdep = rrdep+ & rb-dep
-let to-r = strong-rrdep | rfi-rel-acq
-let fence = strong-fence | wmb | po-rel | rmb | acq-po
+let to-r = rrdep
+let fence = strong-fence | wmb | po-rel | rmb | acq-po | (rel-rf-acq-po & int)
let ppo = rrdep* ; (to-r | to-w | fence)

(* Propagation: Ordering from release operations and strong fences. *)
let A-cumul(r) = rfe? ; r
-let cumul-fence = A-cumul(strong-fence | po-rel) | wmb
+let cumul-fence = A-cumul(strong-fence | po-rel) | wmb | rel-rf-acq-po
let prop = (overwrite & ext)? ; cumul-fence* ; rfe?

(*
--
2.7.4