From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
pingfank@linux.vnet.ibm.com, jan.kiszka@siemens.com,
qemu-devel@nongnu.org, alex@alex.org.uk, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 0/2] block: make aio_poll(ctx, true) block with no fds
Date: Thu, 5 Dec 2013 16:55:52 +0100 [thread overview]
Message-ID: <20131205155552.GA14226@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1385479081-17887-1-git-send-email-stefanha@redhat.com>
On Tue, Nov 26, 2013 at 04:17:59PM +0100, Stefan Hajnoczi wrote:
> v2:
> * Oops, this patch got lost. Rebased onto qemu.git/master for 1.8
>
> Jan and Alex have expressed that aio_poll(ctx, blocking=true) should block even
> when there are no file descriptors registered. This can be handy since other
> threads may still kick the AioContext using aio_notify(ctx).
>
> A concrete example is a thread that has only a timer in its AioContext.
> aio_poll(ctx, true) should block until the timer expires or another thread
> invokes aio_notify(ctx).
>
> Alex and Paolo were concerned about bdrv_drain_all() which has the following
> comment:
>
> while (busy) {
> /* FIXME: We do not have timer support here, so this is effectively
> * a busy wait.
> */
> QTAILQ_FOREACH(bs, &bdrv_states, list) {
> if (bdrv_start_throttled_reqs(bs)) {
> busy = true;
> }
> }
>
> busy = bdrv_requests_pending_all();
> busy |= aio_poll(qemu_get_aio_context(), busy);
> }
>
> Patch 1 drops this outdated comment. The new I/O throttling code already
> eliminated the busy wait.
>
> Patch 2 drops the special case which returns immediately from aio_poll(ctx,
> true) when no file descriptors are registered.
>
> Note that aio_notify(ctx) still causes aio_poll(ctx, true) to return false. I
> don't see a need to change it so aio_poll(ctx, true) always returns true.
>
> Stefan Hajnoczi (2):
> block: clean up bdrv_drain_all() throttling comments
> aio: make aio_poll(ctx, true) block with no fds
>
> aio-posix.c | 5 -----
> aio-win32.c | 5 -----
> block.c | 7 +------
> tests/test-aio.c | 1 -
> 4 files changed, 1 insertion(+), 17 deletions(-)
Applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
prev parent reply other threads:[~2013-12-05 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 15:17 [Qemu-devel] [PATCH v2 0/2] block: make aio_poll(ctx, true) block with no fds Stefan Hajnoczi
2013-11-26 15:18 ` [Qemu-devel] [PATCH v2 1/2] block: clean up bdrv_drain_all() throttling comments Stefan Hajnoczi
2013-11-26 15:18 ` [Qemu-devel] [PATCH v2 2/2] aio: make aio_poll(ctx, true) block with no fds Stefan Hajnoczi
2013-12-05 15:55 ` Stefan Hajnoczi [this message]
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=20131205155552.GA14226@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=alex@alex.org.uk \
--cc=jan.kiszka@siemens.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pingfank@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).