Skip to content

Commit

Permalink
virtio_ring: switch to dma_XX barriers for rpmsg
Browse files Browse the repository at this point in the history
virtio is using barriers to order memory accesses, thus
dma_wmb/rmb is a good match.

Before
[mst@tuck linux]$ size drivers/virtio/virtio_ring.o
   text    data     bss     dec     hex filename
  11392     820       0   12212    2fb4 drivers/virtio/virtio_ring.o

After
mst@tuck linux]$ size drivers/virtio/virtio_ring.o
   text    data     bss     dec     hex filename
  11284     820       0   12104    2f48 drivers/virtio/virtio_ring.o

Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-remoteproc@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
mstsirkin committed Jun 7, 2018
1 parent 29dcea8 commit 55e49dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/virtio_ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ static inline void virtio_rmb(bool weak_barriers)
if (weak_barriers)
virt_rmb();
else
rmb();
dma_rmb();
}

static inline void virtio_wmb(bool weak_barriers)
{
if (weak_barriers)
virt_wmb();
else
wmb();
dma_wmb();
}

static inline void virtio_store_mb(bool weak_barriers,
Expand Down

0 comments on commit 55e49dc

Please sign in to comment.