RFC barriers using data dependency
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest4 patches 36 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | include/linux/compiler*.h: fix OPTIMIZER_HIDE_VARinclude/ include/ include/ +1 more | +6 | 15 replies | |
| 1/4 | include/linux/compiler*.h: fix OPTIMIZER_HIDE_VARinclude/ include/ include/ +1 more | +6 | 0 replies | |
| 2/4 | include/linux/compiler.h: allow memory operandsinclude/ | +1 | 2 replies | |
| 2/4 | include/linux/compiler.h: allow memory operandsinclude/ | +1 | 0 replies | |
| 3/4 | barriers: convert a control to a data dependencyDocumentation/ arch/ include/ +1 more | +43 | 16 replies | |
| 3/4 | barriers: convert a control to a data dependencyDocumentation/ arch/ include/ +1 more | +43 | 0 replies | |
| 4/4 | virtio: use dependent_ptr_mbdrivers/ | +4 | 0 replies | |
| 4/4 | virtio: use dependent_ptr_mbdrivers/ | +4 | 0 replies |
Reviews trailers per patch
2 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Nick Desaulniers |
|---|---|
| 1/4 | R-b |
| 1/4 | R-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.
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