qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 1/3] aio-context: if io_flush isn't provided


From: Kevin Wolf
Subject: Re: [Qemu-devel] [RFC PATCH 1/3] aio-context: if io_flush isn't provided, assume "always busy"
Date: Tue, 2 Apr 2013 10:34:03 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 29.03.2013 um 00:37 hat Paolo Bonzini geschrieben:
> Il 28/03/2013 22:52, Anthony Liguori ha scritto:
> > Today, all callers of qemu_aio_set_fd_handler() pass a valid io_flush
> > function.
> 
> Except one:
> 
>     aio_set_event_notifier(ctx, &ctx->notifier,
>                            (EventNotifierHandler *)
>                            event_notifier_test_and_clear, NULL);
> 
> This is the EventNotifier that is used by qemu_notify_event.
> 
> It's quite surprising that this patch works and passes the tests. /me
> reads cover letter... ah, it is untested. :)
> 
> But if you can eliminate the sole usage of aio_wait()'s return value (in
> bdrv_drain_all()), everything would be much simpler.  There is a
> relatively convenient
> 
>         assert(QLIST_EMPTY(&bs->tracked_requests));
> 
> that you can use as the exit condition instead.  Perhaps it's not
> trivial to do it efficiently, but it's not a fast path.

We just need to move to .bdrv_drain() for all block driver that
register an AioHandler. I'm pretty sure that each one has its own
data structures to manage in-flight requests (basically what is the
aio_flush handler today would become the .bdrv_drain callback).

Then bdrv_drain_all() can directly use the bdrv_drain() return value and
doesn't need to have it passed through aio_wait() any more.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]