Re: [Qemu-devel] [RFC PATCH] async: Fix aio_notify_accept

2018-08-06 Thread Fam Zheng
On Fri, 08/03 19:08, Paolo Bonzini wrote: > On 03/08/2018 17:49, Fam Zheng wrote: > > void aio_notify_accept(AioContext *ctx) > > { > > -if (atomic_xchg(&ctx->notified, false)) { > > +/* If ctx->notify_me >= 2, another aio_poll() is waiting which may > > need the > > + * ctx->notifie

Re: [Qemu-devel] [RFC PATCH] async: Fix aio_notify_accept

2018-08-03 Thread Paolo Bonzini
On 03/08/2018 17:49, Fam Zheng wrote: > void aio_notify_accept(AioContext *ctx) > { > -if (atomic_xchg(&ctx->notified, false)) { > +/* If ctx->notify_me >= 2, another aio_poll() is waiting which may need > the > + * ctx->notifier event to wake up, so don't already clear it just > be

Re: [Qemu-devel] [RFC PATCH] async: Fix aio_notify_accept

2018-08-03 Thread Paolo Bonzini
On 03/08/2018 17:49, Fam Zheng wrote: > void aio_notify_accept(AioContext *ctx) > { > -if (atomic_xchg(&ctx->notified, false)) { > +/* If ctx->notify_me >= 2, another aio_poll() is waiting which may need > the > + * ctx->notifier event to wake up, so don't already clear it just > be

[Qemu-devel] [RFC PATCH] async: Fix aio_notify_accept

2018-08-03 Thread Fam Zheng
>From main loop, bdrv_set_aio_context() can call IOThread's aio_poll(). That breaks aio_notify() because the ctx->notifier event can get cleared too early by this which causes IOThread hanging. See https://bugzilla.redhat.com/show_bug.cgi?id=1562750 for details. Signed-off-by: Fam Zheng --- uti