Skip to content

RFC barriers using data dependency

Michael S. Tsirkin linux-alpha linux-arch linux-doc linux-sparse lkml netdev virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 36 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4include/linux/compiler*.h: fix OPTIMIZER_HIDE_VARinclude/linux/compiler-clang.h include/linux/compiler-gcc.h include/linux/compiler-intel.h +1 more+6 -1115 replies
1/4include/linux/compiler*.h: fix OPTIMIZER_HIDE_VARinclude/linux/compiler-clang.h include/linux/compiler-gcc.h include/linux/compiler-intel.h +1 more+6 -110 replies
2/4include/linux/compiler.h: allow memory operandsinclude/linux/compiler.h+1 -12 replies
2/4include/linux/compiler.h: allow memory operandsinclude/linux/compiler.h+1 -10 replies
3/4barriers: convert a control to a data dependencyDocumentation/memory-barriers.txt arch/alpha/include/asm/barrier.h include/asm-generic/barrier.h +1 more+43 -016 replies
3/4barriers: convert a control to a data dependencyDocumentation/memory-barriers.txt arch/alpha/include/asm/barrier.h include/asm-generic/barrier.h +1 more+43 -00 replies
4/4virtio: use dependent_ptr_mbdrivers/virtio/virtio_ring.c+4 -20 replies
4/4virtio: use dependent_ptr_mbdrivers/virtio/virtio_ring.c+4 -20 replies

Reviews trailers per patch

2 of 8 patches have a Reviewed-by or Acked-by.

PatchNick Desaulniers
1/4R-b
1/4R-b
2/4
2/4
3/4
3/4
4/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 0/4] barriers using data dependency

So as explained in Documentation/memory-barriers.txt e.g. a load followed by a store require a full memory barrier, to avoid store being ordered before the load. Similarly load-load requires a read memory barrier.

Thinking about it, we can actually create a data dependency by mixing the first loaded value into the pointer being accessed.

This adds an API for this and uses it in virtio.

Written over the holiday and build tested only so far.

This patchset is also suboptimal on e.g. x86 where e.g. smp_rmb is a nop.

Sending out for early feedback/flames.

Michael S. Tsirkin (4):
include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR include/linux/compiler.h: allow memory operands
barriers: convert a control to a data dependency
virtio: use dependent_ptr_mb

 Documentation/memory-barriers.txt | 20 ++++++++++++++++++++
 arch/alpha/include/asm/barrier.h  |  1 +
 drivers/virtio/virtio_ring.c      |  6 ++++--
 include/asm-generic/barrier.h     | 18 ++++++++++++++++++
 include/linux/compiler-clang.h    |  5 ++---
 include/linux/compiler-gcc.h      |  4 ----
 include/linux/compiler-intel.h    |  4 +---
 include/linux/compiler.h          |  8 +++++++-
 8 files changed, 53 insertions(+), 13 deletions(-)
Signature · 1 line
MST