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: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH 1/3] aio-context: if io_flush isn't provided, assume "always busy"
Date: Fri, 29 Mar 2013 00:37:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

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.

Paolo

> However, the function allows the handler to be omitted
> and the behavior is a bit strange.
> 
> It will still add the file descriptor to the GSource but it will
> not consider the source to be "busy".  This could lead to aio_flush()
> returning prematurely.
> 
> Since we never rely on this behavior today, it doesn't matter but
> the next patch will start relying on an absent io_flush function
> to assume the handler is always busy.




reply via email to

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