Displaying 12 results from an estimated 12 matches for "dma_mb".
Did you mean:
dma_wmb
2015 Dec 17
1
[PATCH] virtio_ring: use smp_store_mb
...Normal, non-cacheable memory (i.e. the memory type we
use for non-coherent DMA buffers) is outer-shareable.
Since the barrier macros don't know if the device is coherent or not, we
use the stronger semantics of outer-shareable.
I've not been following the thread, but I reckon we could add dma_mb()
(as dmb(osh) on arm), then use that to build dma_load_acquire and
dma_store_release accessors. On arm64, we could probably use the
acquire/release instructions directly, since they inherit the shareability
domain of the address (which has the nice property of being inner-shareable
for coherent de...
2015 Dec 17
1
[PATCH] virtio_ring: use smp_store_mb
...Normal, non-cacheable memory (i.e. the memory type we
use for non-coherent DMA buffers) is outer-shareable.
Since the barrier macros don't know if the device is coherent or not, we
use the stronger semantics of outer-shareable.
I've not been following the thread, but I reckon we could add dma_mb()
(as dmb(osh) on arm), then use that to build dma_load_acquire and
dma_store_release accessors. On arm64, we could probably use the
acquire/release instructions directly, since they inherit the shareability
domain of the address (which has the nice property of being inner-shareable
for coherent de...
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
We need a full barrier after writing out event index, using smp_store_mb
there seems better than open-coding.
As usual, we need a wrapper to account for strong barriers/non smp.
It's tempting to use this in vhost as well, for that, we'll
need a variant of smp_store_mb that works on __user pointers.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
Seems to give a speedup
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
We need a full barrier after writing out event index, using smp_store_mb
there seems better than open-coding.
As usual, we need a wrapper to account for strong barriers/non smp.
It's tempting to use this in vhost as well, for that, we'll
need a variant of smp_store_mb that works on __user pointers.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
Seems to give a speedup
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
...by
commit 9e1a27ea42691429e31f158cce6fc61bc79bb2e9
Author: Alexander Duyck <alexander.h.duyck at redhat.com>
Date: Mon Apr 13 21:03:49 2015 +0930
virtio_ring: Update weak barriers to use dma_wmb/rmb
> As previously stated, smp_mb() does not cover the same memory domains as
> dma_mb() would.
I know. We used to consistently do the right thing on SMP,
but on UP Linux does not have good portable APIs for us
to use. So we hack around with what's available which is
typically stronger than what's really needed.
I guess no one cares about UP that much.
The Alexander came...
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
...by
commit 9e1a27ea42691429e31f158cce6fc61bc79bb2e9
Author: Alexander Duyck <alexander.h.duyck at redhat.com>
Date: Mon Apr 13 21:03:49 2015 +0930
virtio_ring: Update weak barriers to use dma_wmb/rmb
> As previously stated, smp_mb() does not cover the same memory domains as
> dma_mb() would.
I know. We used to consistently do the right thing on SMP,
but on UP Linux does not have good portable APIs for us
to use. So we hack around with what's available which is
typically stronger than what's really needed.
I guess no one cares about UP that much.
The Alexander came...
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
virtio ring entries have exactly the acquire/release
semantics:
- reading used index acquires a ring entry from host
- updating the available index releases it to host
Thus when using weak barriers and building for SMP (as most people
do), smp_load_acquire and smp_store_release will do exactly
the right thing to synchronize with the host.
In fact, QEMU already uses
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
virtio ring entries have exactly the acquire/release
semantics:
- reading used index acquires a ring entry from host
- updating the available index releases it to host
Thus when using weak barriers and building for SMP (as most people
do), smp_load_acquire and smp_store_release will do exactly
the right thing to synchronize with the host.
In fact, QEMU already uses
2015 Dec 17
0
[PATCH] virtio_ring: use smp_store_mb
...gt; +#endif
> + {
> + WRITE_ONCE(*p, v);
> + mb();
> + }
> +}
Note that virtio_mb() is weirdly inconsistent with virtio_[rw]mb() in
that they use dma_* ops for weak_barriers, while virtio_mb() uses
smp_mb().
As previously stated, smp_mb() does not cover the same memory domains as
dma_mb() would.
2015 Dec 17
0
[PATCH] virtio: use smp_load_acquire/smp_store_release
...osh), while the smp_mb() used by smp_load_acquire() is
dmb(ish). They order completely different types of memory accesses.
Also, load_acquire() is first load, then barrier, and an ACQUIRE barrier
at that, not a READ barrier.
So your #else branch should look something like:
var = READ_ONCE(*p);
dma_mb();
return var;
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
On Thu, Dec 17, 2015 at 03:02:12PM +0100, Peter Zijlstra wrote:
> On Thu, Dec 17, 2015 at 03:26:29PM +0200, Michael S. Tsirkin wrote:
> > > Note that virtio_mb() is weirdly inconsistent with virtio_[rw]mb() in
> > > that they use dma_* ops for weak_barriers, while virtio_mb() uses
> > > smp_mb().
> >
> > It's a hack really. I think I'll clean it
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
On Thu, Dec 17, 2015 at 03:02:12PM +0100, Peter Zijlstra wrote:
> On Thu, Dec 17, 2015 at 03:26:29PM +0200, Michael S. Tsirkin wrote:
> > > Note that virtio_mb() is weirdly inconsistent with virtio_[rw]mb() in
> > > that they use dma_* ops for weak_barriers, while virtio_mb() uses
> > > smp_mb().
> >
> > It's a hack really. I think I'll clean it