search for: dma_rmb

Displaying 20 results from an estimated 67 matches for "dma_rmb".

2015 Apr 08
3
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...@@ -21,19 +21,20 @@ * actually quite cheap. */ -#ifdef CONFIG_SMP static inline void virtio_mb(bool weak_barriers) { +#ifdef CONFIG_SMP if (weak_barriers) smp_mb(); else +#endif mb(); } static inline void virtio_rmb(bool weak_barriers) { if (weak_barriers) - smp_rmb(); + dma_rmb(); else rmb(); } @@ -41,26 +42,10 @@ static inline void virtio_rmb(bool weak_barriers) static inline void virtio_wmb(bool weak_barriers) { if (weak_barriers) - smp_wmb(); + dma_wmb(); else wmb(); } -#else -static inline void virtio_mb(bool weak_barriers) -{ - mb(); -} - -static in...
2015 Apr 08
3
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...@@ -21,19 +21,20 @@ * actually quite cheap. */ -#ifdef CONFIG_SMP static inline void virtio_mb(bool weak_barriers) { +#ifdef CONFIG_SMP if (weak_barriers) smp_mb(); else +#endif mb(); } static inline void virtio_rmb(bool weak_barriers) { if (weak_barriers) - smp_rmb(); + dma_rmb(); else rmb(); } @@ -41,26 +42,10 @@ static inline void virtio_rmb(bool weak_barriers) static inline void virtio_wmb(bool weak_barriers) { if (weak_barriers) - smp_wmb(); + dma_wmb(); else wmb(); } -#else -static inline void virtio_mb(bool weak_barriers) -{ - mb(); -} - -static in...
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...tio_ring.h @@ -47,6 +47,36 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p) +{ + if (!weak_barriers) { + rmb(); + return READ_ONCE(*p); + } +#ifdef CONFIG_SMP + return smp_load_acquire(p); +#else + dma_rmb(); + return READ_ONCE(*p); +#endif +} + +static inline void virtio_store_release(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ + if (!weak_barriers) { + wmb(); + WRITE_ONCE(*p, v); + return; + } +#ifdef CONFIG_SMP + smp_store_release(p, v); +#else + dma_wmb(); + WRITE_ONCE(*p, v); +#...
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...tio_ring.h @@ -47,6 +47,36 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p) +{ + if (!weak_barriers) { + rmb(); + return READ_ONCE(*p); + } +#ifdef CONFIG_SMP + return smp_load_acquire(p); +#else + dma_rmb(); + return READ_ONCE(*p); +#endif +} + +static inline void virtio_store_release(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ + if (!weak_barriers) { + wmb(); + WRITE_ONCE(*p, v); + return; + } +#ifdef CONFIG_SMP + smp_store_release(p, v); +#else + dma_wmb(); + WRITE_ONCE(*p, v); +#...
2015 Apr 08
2
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...to this is that these barriers are available to uniprocessor >> builds as well so the performance should improve under such a >> configuration. >> >> Signed-off-by: Alexander Duyck <alexander.h.duyck at redhat.com> > Well the generic implementation has: > #ifndef dma_rmb > #define dma_rmb() rmb() > #endif > > #ifndef dma_wmb > #define dma_wmb() wmb() > #endif > > So for these arches you are slightly speeding up UP but slightly hurting SMP - > I think we did benchmark the difference as measureable in the past. The generic impl...
2015 Apr 08
2
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...to this is that these barriers are available to uniprocessor >> builds as well so the performance should improve under such a >> configuration. >> >> Signed-off-by: Alexander Duyck <alexander.h.duyck at redhat.com> > Well the generic implementation has: > #ifndef dma_rmb > #define dma_rmb() rmb() > #endif > > #ifndef dma_wmb > #define dma_wmb() wmb() > #endif > > So for these arches you are slightly speeding up UP but slightly hurting SMP - > I think we did benchmark the difference as measureable in the past. The generic impl...
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...ns(-) 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
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...ns(-) 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
2015 Apr 08
0
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...gt; > The advantage to this is that these barriers are available to uniprocessor > builds as well so the performance should improve under such a > configuration. > > Signed-off-by: Alexander Duyck <alexander.h.duyck at redhat.com> Well the generic implementation has: #ifndef dma_rmb #define dma_rmb() rmb() #endif #ifndef dma_wmb #define dma_wmb() wmb() #endif So for these arches you are slightly speeding up UP but slightly hurting SMP - I think we did benchmark the difference as measureable in the past. Additionally, isn't this relying on undocumented behavi...
2016 Jan 12
4
[v3,11/41] mips: reuse asm-generic/barrier.h
On 01/10/2016 06:18 AM, Michael S. Tsirkin wrote: > On mips dma_rmb, dma_wmb, smp_store_mb, read_barrier_depends, > smp_read_barrier_depends, smp_store_release and smp_load_acquire match > the asm-generic variants exactly. Drop the local definitions and pull in > asm-generic/barrier.h instead. > This statement doesn't fit MIPS barriers variations....
2016 Jan 12
4
[v3,11/41] mips: reuse asm-generic/barrier.h
On 01/10/2016 06:18 AM, Michael S. Tsirkin wrote: > On mips dma_rmb, dma_wmb, smp_store_mb, read_barrier_depends, > smp_read_barrier_depends, smp_store_release and smp_load_acquire match > the asm-generic variants exactly. Drop the local definitions and pull in > asm-generic/barrier.h instead. > This statement doesn't fit MIPS barriers variations....
2016 Jan 04
2
[PATCH v2 22/32] s390: define __smp_xxx
..., 6 deletions(-) > > diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h > index c358c31..fbd25b2 100644 > --- a/arch/s390/include/asm/barrier.h > +++ b/arch/s390/include/asm/barrier.h > @@ -26,18 +26,21 @@ > #define wmb() barrier() > #define dma_rmb() mb() > #define dma_wmb() mb() > -#define smp_mb() mb() > -#define smp_rmb() rmb() > -#define smp_wmb() wmb() > - > -#define smp_store_release(p, v) \ > +#define __smp_mb() mb() > +#define __smp_rmb() rmb() > +#define __smp_wmb() wmb() > +#define...
2016 Jan 04
2
[PATCH v2 22/32] s390: define __smp_xxx
..., 6 deletions(-) > > diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h > index c358c31..fbd25b2 100644 > --- a/arch/s390/include/asm/barrier.h > +++ b/arch/s390/include/asm/barrier.h > @@ -26,18 +26,21 @@ > #define wmb() barrier() > #define dma_rmb() mb() > #define dma_wmb() mb() > -#define smp_mb() mb() > -#define smp_rmb() rmb() > -#define smp_wmb() wmb() > - > -#define smp_store_release(p, v) \ > +#define __smp_mb() mb() > +#define __smp_rmb() rmb() > +#define __smp_wmb() wmb() > +#define...
2015 Apr 08
0
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...riers are available to uniprocessor > >>builds as well so the performance should improve under such a > >>configuration. > >> > >>Signed-off-by: Alexander Duyck <alexander.h.duyck at redhat.com> > >Well the generic implementation has: > >#ifndef dma_rmb > >#define dma_rmb() rmb() > >#endif > > > >#ifndef dma_wmb > >#define dma_wmb() wmb() > >#endif > > > >So for these arches you are slightly speeding up UP but slightly hurting SMP - > >I think we did benchmark the difference as meas...
2015 Dec 17
0
[PATCH] virtio: use smp_load_acquire/smp_store_release
...12:29:03PM +0200, Michael S. Tsirkin wrote: > +static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p) > +{ > + if (!weak_barriers) { > + rmb(); > + return READ_ONCE(*p); > + } > +#ifdef CONFIG_SMP > + return smp_load_acquire(p); > +#else > + dma_rmb(); > + return READ_ONCE(*p); > +#endif > +} This too is wrong. Look for example at arm. dma_rmb() is dmb(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 AC...
2015 Dec 30
0
[PATCH 07/34] sparc: reuse asm-generic/barrier.h
On sparc 64 bit dma_rmb, dma_wmb, smp_store_mb, smp_mb, smp_rmb, smp_wmb, read_barrier_depends and smp_read_barrier_depends match the asm-generic variants exactly. Drop the local definitions and pull in asm-generic/barrier.h instead. nop uses __asm__ __volatile but is otherwise identical to the generic version, drop that...
2015 Dec 31
0
[PATCH v2 07/32] sparc: reuse asm-generic/barrier.h
On sparc 64 bit dma_rmb, dma_wmb, smp_store_mb, smp_mb, smp_rmb, smp_wmb, read_barrier_depends and smp_read_barrier_depends match the asm-generic variants exactly. Drop the local definitions and pull in asm-generic/barrier.h instead. nop uses __asm__ __volatile but is otherwise identical to the generic version, drop that...
2015 Dec 31
0
[PATCH v2 11/32] mips: reuse asm-generic/barrier.h
On mips dma_rmb, dma_wmb, smp_store_mb, read_barrier_depends, smp_read_barrier_depends, smp_store_release and smp_load_acquire match the asm-generic variants exactly. Drop the local definitions and pull in asm-generic/barrier.h instead. This is in preparation to refactoring this code area. Signed-off-by: Michae...
2015 Dec 31
0
[PATCH v2 10/32] metag: reuse asm-generic/barrier.h
On metag dma_rmb, dma_wmb, smp_store_mb, read_barrier_depends, smp_read_barrier_depends, smp_store_release and smp_load_acquire match the asm-generic variants exactly. Drop the local definitions and pull in asm-generic/barrier.h instead. This is in preparation to refactoring this code area. Signed-off-by: Michae...
2016 Jan 10
0
[PATCH v3 27/41] x86: define __smp_xxx
...iff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h index cc4c2a7..a584e1c 100644 --- a/arch/x86/include/asm/barrier.h +++ b/arch/x86/include/asm/barrier.h @@ -31,17 +31,10 @@ #endif #define dma_wmb() barrier() -#ifdef CONFIG_SMP -#define smp_mb() mb() -#define smp_rmb() dma_rmb() -#define smp_wmb() barrier() -#define smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0) -#else /* !SMP */ -#define smp_mb() barrier() -#define smp_rmb() barrier() -#define smp_wmb() barrier() -#define smp_store_mb(var, value) do { WRITE_ONCE(var, value); barrier(); } while (0...