From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: borntraeger@de.ibm.com, Fam Zheng <famz@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Karl Rister <krister@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 09/10] aio: add .io_poll_begin/end() callbacks
Date: Wed, 23 Nov 2016 11:59:18 +0100 [thread overview]
Message-ID: <6b09dd0e-0aa5-db85-1251-acac9e2158fa@redhat.com> (raw)
In-Reply-To: <20161123094441.GD20034@stefanha-x1.localdomain>
On 23/11/2016 10:44, Stefan Hajnoczi wrote:
> I thought about the final poll but decided it was nicer for virtio.c to
> do it internally. Not all .io_poll_end() implementations may require an
> additional poll so it seemed more optimal to leave it up to each
> callback.
>
> If you prefer the run_poll_handlers_once(ctx) approach I'll switch to
> that.
I think the question is more whether it makes sense to poll once even
for non-blocking aio_poll. I think it does; after all, why even call
ppoll() if all sources support polling and you don't need to sleep? :)
Doing the run_poll_handlers_once automatically after .io_poll_end()
would be a side effect of how to write that code, but it's the less
interesting part.
BTW, iothread.c doesn't use non-blocking aio_poll, but there are
interesting opportunities for (micro)optimization of the event loop
involving non-blocking mode. For example we could add a
if (atomic_read(&ctx->notified)) {
blocking = false;
}
at the beginning of aio_poll. When a bottom half is scheduled, this
would avoid further notifications (notify_me stays zero) and skip
aio_compute_timeout. I think it's worthwhile for aio=threads, but it
would be a pity to lose polling in this case. The null backend also
uses bottom halves heavily, either directly for null-aio:// or through
bdrv_co_maybe_schedule_bh for null-co://.
Paolo
next prev parent reply other threads:[~2016-11-23 10:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-22 16:31 [Qemu-devel] [PATCH v3 00/10] aio: experimental virtio-blk polling mode Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 01/10] virtio: add missing vdev->broken check Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 02/10] virtio-blk: suppress virtqueue kick during processing Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 03/10] virtio-scsi: " Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 04/10] aio: add AioPollFn and io_poll() interface Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 05/10] aio: add polling mode to AioContext Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 06/10] virtio: poll virtqueues for new buffers Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 07/10] linux-aio: poll ring for completions Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 08/10] virtio: turn vq->notification into a nested counter Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 09/10] aio: add .io_poll_begin/end() callbacks Stefan Hajnoczi
2016-11-22 17:21 ` Paolo Bonzini
2016-11-23 9:44 ` Stefan Hajnoczi
2016-11-23 10:59 ` Paolo Bonzini [this message]
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 10/10] virtio: disable virtqueue notifications during polling Stefan Hajnoczi
2016-11-22 16:57 ` [Qemu-devel] [PATCH v3 00/10] aio: experimental virtio-blk polling mode no-reply
2016-11-22 17:13 ` Paolo Bonzini
2016-11-22 19:21 ` Christian Borntraeger
2016-11-23 9:51 ` Stefan Hajnoczi
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=6b09dd0e-0aa5-db85-1251-acac9e2158fa@redhat.com \
--to=pbonzini@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=famz@redhat.com \
--cc=krister@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--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).