Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-25 Thread Sergey Fedorov
On 25/05/16 11:52, Alex Bennée wrote: > Sergey Fedorov writes: > >> On 24/05/16 22:56, Emilio G. Cota wrote: >>> On Tue, May 24, 2016 at 09:08:01 +0200, Paolo Bonzini wrote: On 23/05/2016 19:09, Emilio G. Cota wrote: > PS. And really equating smp_wmb/rmb to release/acquire as we have unde

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-25 Thread Alex Bennée
Sergey Fedorov writes: > On 24/05/16 22:56, Emilio G. Cota wrote: >> On Tue, May 24, 2016 at 09:08:01 +0200, Paolo Bonzini wrote: >>> On 23/05/2016 19:09, Emilio G. Cota wrote: PS. And really equating smp_wmb/rmb to release/acquire as we have under #ifdef __ATOMIC is hard to justify, o

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-24 Thread Sergey Fedorov
On 24/05/16 22:56, Emilio G. Cota wrote: > On Tue, May 24, 2016 at 09:08:01 +0200, Paolo Bonzini wrote: >> On 23/05/2016 19:09, Emilio G. Cota wrote: >>> PS. And really equating smp_wmb/rmb to release/acquire as we have under >>> #ifdef __ATOMIC is hard to justify, other than to please tsan. >> Tha

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-24 Thread Emilio G. Cota
On Tue, May 24, 2016 at 09:08:01 +0200, Paolo Bonzini wrote: > On 23/05/2016 19:09, Emilio G. Cota wrote: > > PS. And really equating smp_wmb/rmb to release/acquire as we have under > > #ifdef __ATOMIC is hard to justify, other than to please tsan. > > That only makes a difference on arm64, right?

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-24 Thread Emilio G. Cota
On Sun, May 22, 2016 at 08:58:51 +0100, Alex Bennée wrote: > For tsan runs you need to re-build with: > > ./configure --cc=gcc --extra-cflags="-pie -fPIE -fsanitize=thread" > --with-coroutine=gthread > > Specifically the coroutine ucontext messing really confuses TSAN. With your configure arg

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-24 Thread Paolo Bonzini
On 23/05/2016 19:09, Emilio G. Cota wrote: > E. > > PS. And really equating smp_wmb/rmb to release/acquire as we have under > #ifdef __ATOMIC is hard to justify, other than to please tsan. That only makes a difference on arm64, right? acquire release rmb

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-23 Thread Emilio G. Cota
On Mon, May 23, 2016 at 09:53:00 -0700, Richard Henderson wrote: > On 05/21/2016 01:42 PM, Emilio G. Cota wrote: > >In the process, the atomic_rcu_read/set were converted to implement > >consume/release semantics, respectively. This is inefficient; for > >correctness and maximum performance we only

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-23 Thread Richard Henderson
On 05/21/2016 01:42 PM, Emilio G. Cota wrote: In the process, the atomic_rcu_read/set were converted to implement consume/release semantics, respectively. This is inefficient; for correctness and maximum performance we only need an smp_barrier_depends for reads, and an smp_wmb for writes. Fix it

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-23 Thread Emilio G. Cota
On Mon, May 23, 2016 at 16:21:36 +0200, Paolo Bonzini wrote: > On 21/05/2016 22:42, Emilio G. Cota wrote: > > Commit a0aa44b4 ("include/qemu/atomic.h: default to __atomic functions") > > set all atomics to default (on recent GCC versions) to __atomic primitives. > > > > In the process, the atomic_

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-23 Thread Paolo Bonzini
On 21/05/2016 22:42, Emilio G. Cota wrote: > Commit a0aa44b4 ("include/qemu/atomic.h: default to __atomic functions") > set all atomics to default (on recent GCC versions) to __atomic primitives. > > In the process, the atomic_rcu_read/set were converted to implement > consume/release semantics,

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-22 Thread Alex Bennée
Emilio G. Cota writes: > Commit a0aa44b4 ("include/qemu/atomic.h: default to __atomic functions") > set all atomics to default (on recent GCC versions) to __atomic primitives. > > In the process, the atomic_rcu_read/set were converted to implement > consume/release semantics, respectively. This

[Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-21 Thread Emilio G. Cota
Commit a0aa44b4 ("include/qemu/atomic.h: default to __atomic functions") set all atomics to default (on recent GCC versions) to __atomic primitives. In the process, the atomic_rcu_read/set were converted to implement consume/release semantics, respectively. This is inefficient; for correctness and