qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Paolo Bonzini <bonzini@redhat.com>,
	qemu-devel@nongnu.org, Mike Roth <mdroth@linux.vnet.ibm.com>
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	[thread overview]
Message-ID: <5154D42E.70804@redhat.com> (raw)
In-Reply-To: <1364507550-25093-2-git-send-email-aliguori@us.ibm.com>

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	other threads:[~2013-03-28 23:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 21:52 [Qemu-devel] [RFC PATCH 0/3] aio-context start to eliminate io_flush Anthony Liguori
2013-03-28 21:52 ` [Qemu-devel] [RFC PATCH 1/3] aio-context: if io_flush isn't provided, assume "always busy" Anthony Liguori
2013-03-28 23:37   ` Paolo Bonzini [this message]
2013-04-02  8:34     ` Kevin Wolf
2013-04-08 15:28     ` Stefan Hajnoczi
2013-03-28 21:52 ` [Qemu-devel] [RFC PATCH 2/3] sheepdog: pass NULL for io_flush Anthony Liguori
2013-03-28 23:38   ` Paolo Bonzini
2013-04-02  8:37   ` Kevin Wolf
2013-04-02 10:15     ` Paolo Bonzini
2013-04-08 15:31     ` Stefan Hajnoczi
2013-04-08 15:38       ` Kevin Wolf
2013-03-28 21:52 ` [Qemu-devel] [RFC PATCH 3/3] rbd: remove aio handler when no requests are pending Anthony Liguori
2013-03-28 23:39   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5154D42E.70804@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=bonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).