[lkml]   [2019]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 00/13] Finish off [smp_]read_barrier_depends()
Hi all,

Although [smp_]read_barrier_depends() became part of READ_ONCE() in
commit 76ebbe78f739 ("locking/barriers: Add implicit
smp_read_barrier_depends() to READ_ONCE()"), it still limps on in the
Linux memory model with the sinister hope of attracting innocent new
users so that it becomes impossible to remove altogether.

Let's strike before it's too late: there's only one user outside of
arch/alpha/ and that lives in the vhost code which I don't think you
can actually compile for Alpha. Even if you could, it appears to be
redundant. The rest of these patches remove any mention of the barrier
from Documentation and comments, as well as removing its use from the
Alpha backend and finally dropping it from the memory model completely.

After this series, there are still two places where it is mentioned:

1. The Korean translation of memory-barriers.txt. I'd appreciate some
help fixing this because it's not entirely a straightforward

2. The virtio vring tests under tools/. This is userspace code so I'm
not too fussed about it.

There's a chunk of header reshuffling at the start of the series so that
READ_ONCE() can sensibly be overridden by arch code.

Feedback welcome.



Cc: Yunjae Lee <>
Cc: SeongJae Park <>
Cc: "Paul E. McKenney" <>
Cc: Josh Triplett <>
Cc: Matt Turner <>
Cc: Ivan Kokshaysky <>
Cc: Richard Henderson <>
Cc: Peter Zijlstra <>
Cc: Alan Stern <>
Cc: Michael Ellerman <>
Cc: "Michael S. Tsirkin" <>
Cc: Jason Wang <>
Cc: Arnd Bergmann <>
Cc: Joe Perches <>
Cc: Boqun Feng <>


Will Deacon (13):
compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h
READ_ONCE: Undefine internal __READ_ONCE_SIZE macro after use
READ_ONCE: Allow __READ_ONCE_SIZE cases to be overridden by the
vhost: Remove redundant use of read_barrier_depends() barrier
alpha: Override READ_ONCE() with barriered implementation
READ_ONCE: Remove smp_read_barrier_depends() invocation
alpha: Replace smp_read_barrier_depends() usage with smp_[r]mb()
locking/barriers: Remove definitions for [smp_]read_barrier_depends()
Documentation/barriers: Remove references to
tools/memory-model: Remove smp_read_barrier_depends() from informal
powerpc: Remove comment about read_barrier_depends()
include/linux: Remove smp_read_barrier_depends() from comments
checkpatch: Remove checks relating to [smp_]read_barrier_depends()

.../RCU/Design/Requirements/Requirements.html | 11 +-
Documentation/memory-barriers.txt | 156 +-----------------
arch/alpha/include/asm/atomic.h | 16 +-
arch/alpha/include/asm/barrier.h | 61 +------
arch/alpha/include/asm/pgtable.h | 10 +-
arch/alpha/include/asm/rwonce.h | 22 +++
arch/powerpc/include/asm/barrier.h | 2 -
drivers/vhost/vhost.c | 5 -
include/asm-generic/Kbuild | 1 +
include/asm-generic/barrier.h | 17 --
include/asm-generic/rwonce.h | 131 +++++++++++++++
include/linux/compiler.h | 114 +------------
include/linux/compiler_attributes.h | 12 ++
include/linux/percpu-refcount.h | 2 +-
include/linux/ptr_ring.h | 2 +-
mm/memory.c | 2 +-
scripts/ | 9 +-
.../Documentation/explanation.txt | 26 ++-
18 files changed, 217 insertions(+), 382 deletions(-)
create mode 100644 arch/alpha/include/asm/rwonce.h
create mode 100644 include/asm-generic/rwonce.h


 \ /
  Last update: 2019-11-08 18:03    [W:0.098 / U:14.060 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site