Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/memory-model: Define effect of Mb tags on RMWs in tools/...

Herd7 transforms successful RMW with Mb tags by inserting smp_mb() fences
around them. We emulate this by considering imaginary po-edges before the
RMW read and before the RMW write, and extending the smp_mb() ordering
rule, which currently only applies to real po edges that would be found
around a really inserted smp_mb(), also to cases of the only imagined po
edges.

Reported-by: Viktor Vafeiadis <viktor@mpi-sws.org>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jonas Oberhauser <jonas.oberhauser@huaweicloud.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Tested-by: Boqun Feng <boqun.feng@gmail.com>

authored by

Jonas Oberhauser and committed by
Paul E. McKenney
29279349 723177d7

+10
+10
tools/memory-model/linux-kernel.cat
··· 34 34 let rmb = [R4rmb] ; fencerel(Rmb) ; [R4rmb] 35 35 let wmb = [W] ; fencerel(Wmb) ; [W] 36 36 let mb = ([M] ; fencerel(Mb) ; [M]) | 37 + (* 38 + * full-barrier RMWs (successful cmpxchg(), xchg(), etc.) act as 39 + * though there were enclosed by smp_mb(). 40 + * The effect of these virtual smp_mb() is formalized by adding 41 + * Mb tags to the read and write of the operation, and providing 42 + * the same ordering as though there were additional po edges 43 + * between the Mb tag and the read resp. write. 44 + *) 45 + ([M] ; po ; [Mb & R]) | 46 + ([Mb & W] ; po ; [M]) | 37 47 ([M] ; fencerel(Before-atomic) ; [RMW] ; po? ; [M]) | 38 48 ([M] ; po? ; [RMW] ; fencerel(After-atomic) ; [M]) | 39 49 ([M] ; po? ; [LKW] ; fencerel(After-spinlock) ; [M]) |