Re: [Qemu-devel] aio: reg. smp_read_barrier_depends() in aio_bh_poll()

2016-09-05 Thread Paolo Bonzini
On 02/09/2016 20:23, Pranith Kumar wrote: > If I understand you correctly, this is what might happen without the > barrier(): > > P0P1 > > // bh = ctx->first_bh; optimized > if (ctx->first_bh)

Re: [Qemu-devel] aio: reg. smp_read_barrier_depends() in aio_bh_poll()

2016-09-02 Thread Pranith Kumar
Paolo Bonzini writes: > On 02/09/2016 16:33, Pranith Kumar wrote: >> >> Hi Paolo, >> >> This is in reference to the discussion we had yesterday on IRC. I am trying >> to >> understand the need for smp_read_barrier_depends() and how it prevents the >> following race condition. I think a regular

Re: [Qemu-devel] aio: reg. smp_read_barrier_depends() in aio_bh_poll()

2016-09-02 Thread Paolo Bonzini
On 02/09/2016 16:33, Pranith Kumar wrote: > > Hi Paolo, > > This is in reference to the discussion we had yesterday on IRC. I am trying to > understand the need for smp_read_barrier_depends() and how it prevents the > following race condition. I think a regular barrier() should suffice instead

[Qemu-devel] aio: reg. smp_read_barrier_depends() in aio_bh_poll()

2016-09-02 Thread Pranith Kumar
Hi Paolo, This is in reference to the discussion we had yesterday on IRC. I am trying to understand the need for smp_read_barrier_depends() and how it prevents the following race condition. I think a regular barrier() should suffice instead of smp_read_barrier_depends(). Consider: P0