Re: [Qemu-devel] [PATCH] aio: Remove spurious smp_read_barrier_depends()

2016-09-01 Thread Paolo Bonzini
On 01/09/2016 16:40, Pranith Kumar wrote: >> > >> > bh is shared since it is equal to ctx->first_bh or >> > ctx->first_bh->...->next. While the compiler will always order the load >> > of bh->next after the load of ctx->first_bh and any previous load of >> > bh->next, this may not be the case fo

Re: [Qemu-devel] [PATCH] aio: Remove spurious smp_read_barrier_depends()

2016-09-01 Thread Pranith Kumar
On Thu, Sep 1, 2016 at 7:01 AM, Paolo Bonzini wrote: > > > On 01/09/2016 00:29, Pranith Kumar wrote: >> smp_read_barrier_depends() should be used only if you are reading >> dependent pointers which are shared. > > bh is shared since it is equal to ctx->first_bh or > ctx->first_bh->...->next. Whil

Re: [Qemu-devel] [PATCH] aio: Remove spurious smp_read_barrier_depends()

2016-09-01 Thread Paolo Bonzini
On 01/09/2016 00:29, Pranith Kumar wrote: > smp_read_barrier_depends() should be used only if you are reading > dependent pointers which are shared. bh is shared since it is equal to ctx->first_bh or ctx->first_bh->...->next. While the compiler will always order the load of bh->next after the l

[Qemu-devel] [PATCH] aio: Remove spurious smp_read_barrier_depends()

2016-08-31 Thread Pranith Kumar
smp_read_barrier_depends() should be used only if you are reading dependent pointers which are shared. Here 'bh' is a local variable and dereferencing it will always be ordered after loading 'bh', i.e., bh->next will always be ordered after fetching bh. This patch removes the barrier and adds a co