All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: "Michael S. Tsirkin" <mst@redhat.com>, Suman Anna <s-anna@ti.com>,
	Loic Pallardy <loic.pallardy@st.com>
Cc: linux-kernel@vger.kernel.org, Ohad Ben-Cohen <ohad@wizery.com>,
	linux-remoteproc@vger.kernel.org,
	Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
Date: Mon, 4 Jun 2018 13:02:24 -0700	[thread overview]
Message-ID: <20180604200224.GA9960@builder> (raw)
In-Reply-To: <1524159181-351878-1-git-send-email-mst@redhat.com>

On Thu 19 Apr 10:35 PDT 2018, Michael S. Tsirkin wrote:

> virtio is using barriers to order memory accesses, thus
> dma_wmb/rmb is a good match.
> 
> Build-tested on x86: 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>

Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
> 
> It's good in theory, but could one of RPMSG maintainers please review
> and ack this patch? Or even better test it?
> 
> All these barriers are useless on Intel anyway ...
> 
>  include/linux/virtio_ring.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
> index bbf3252..fab0213 100644
> --- a/include/linux/virtio_ring.h
> +++ b/include/linux/virtio_ring.h
> @@ -35,7 +35,7 @@ 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)
> @@ -43,7 +43,7 @@ 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,
> -- 
> MST

  parent reply	other threads:[~2018-06-04 20:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 17:35 [PATCH] virtio_ring: switch to dma_XX barriers for rpmsg Michael S. Tsirkin
2018-04-19 17:39 ` Paolo Bonzini
2018-04-19 17:39   ` Paolo Bonzini
2018-04-19 17:46   ` Michael S. Tsirkin
2018-04-19 17:46   ` Michael S. Tsirkin
2018-04-19 17:48     ` Paolo Bonzini
2018-04-19 17:48     ` Paolo Bonzini
2018-04-19 18:10       ` Michael S. Tsirkin
2018-04-19 18:10       ` Michael S. Tsirkin
2018-05-30 14:10       ` Michael S. Tsirkin
2018-05-30 14:10       ` Michael S. Tsirkin
2018-06-04 20:16       ` Bjorn Andersson
2018-06-04 20:16       ` Bjorn Andersson
2018-04-20  3:04 ` Jason Wang
2018-04-20  3:04 ` Jason Wang
2018-06-04 20:02 ` Bjorn Andersson [this message]
2018-06-04 20:02 ` Bjorn Andersson
  -- strict thread matches above, loose matches on Subject: below --
2018-04-19 17:35 Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180604200224.GA9960@builder \
    --to=bjorn.andersson@linaro.org \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=mst@redhat.com \
    --cc=ohad@wizery.com \
    --cc=pbonzini@redhat.com \
    --cc=s-anna@ti.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.