Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-16 Thread Stefan Hajnoczi
On Wed, Jul 15, 2015 at 07:13:23PM +0200, Paolo Bonzini wrote: > This patch rewrites the ctx->dispatching optimization, which was the cause > of some mysterious hangs that could be reproduced on aarch64 KVM only. > The hangs were indirectly caused by aio_poll() and in particular by > flash memory u

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-16 Thread Paolo Bonzini
On 16/07/2015 11:14, Kevin Wolf wrote: >>> With this information, I understand that what has changed is that the >>> > > return value of g_main_context_iteration() changes from true before this >>> > > patch (had the aio_notify() from aio_set_fd_handler() pending) to false >>> > > after the patch

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-16 Thread Stefan Hajnoczi
On Thu, Jul 16, 2015 at 01:29:20PM +0800, Fam Zheng wrote: > On Wed, 07/15 19:13, Paolo Bonzini wrote: > > This patch rewrites the ctx->dispatching optimization > > I lost track, but what was the justification of this optimization? To avoid signalling the event notifier when it's not necessary.

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-16 Thread Kevin Wolf
Am 16.07.2015 um 00:59 hat Paolo Bonzini geschrieben: > On 15/07/2015 22:14, Kevin Wolf wrote: > > > index 233d8f5..ae7c6cf 100644 > > > --- a/aio-win32.c > > > +++ b/aio-win32.c > > > @@ -318,11 +313,11 @@ bool aio_poll(AioContext *ctx, bool blocking) > > > first = true; > > > > > > /*

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-16 Thread Paolo Bonzini
On 16/07/2015 07:29, Fam Zheng wrote: >> This patch rewrites the ctx->dispatching optimization > > I lost track, but what was the justification of this optimization? qemu_bh_schedule's call to aio_notify were showing in the profile as 20% or so. Paolo > Anyway, awesome debugging and explanat

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-15 Thread Fam Zheng
On Wed, 07/15 19:13, Paolo Bonzini wrote: > This patch rewrites the ctx->dispatching optimization I lost track, but what was the justification of this optimization? Anyway, awesome debugging and explanations! Fam

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-15 Thread Paolo Bonzini
On 15/07/2015 22:14, Kevin Wolf wrote: > > index 233d8f5..ae7c6cf 100644 > > --- a/aio-win32.c > > +++ b/aio-win32.c > > @@ -318,11 +313,11 @@ bool aio_poll(AioContext *ctx, bool blocking) > > first = true; > > > > /* wait until next event */ > > -while (count > 0) { > > +do {

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-15 Thread Kevin Wolf
Am 15.07.2015 um 19:13 hat Paolo Bonzini geschrieben: > This patch rewrites the ctx->dispatching optimization, which was the cause > of some mysterious hangs that could be reproduced on aarch64 KVM only. > The hangs were indirectly caused by aio_poll() and in particular by > flash memory updates's

Re: [Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-15 Thread Laszlo Ersek
comments below On 07/15/15 19:13, Paolo Bonzini wrote: > This patch rewrites the ctx->dispatching optimization, which was the cause > of some mysterious hangs that could be reproduced on aarch64 KVM only. > The hangs were indirectly caused by aio_poll() and in particular by > flash memory updates'

[Qemu-devel] [PATCH] AioContext: fix broken ctx->dispatching optimization

2015-07-15 Thread Paolo Bonzini
This patch rewrites the ctx->dispatching optimization, which was the cause of some mysterious hangs that could be reproduced on aarch64 KVM only. The hangs were indirectly caused by aio_poll() and in particular by flash memory updates's call to blk_write(), which invokes aio_poll(). Fun stuff: they