From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
Karl Rister <krister@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org, Andrew Theurer <atheurer@redhat.com>
Subject: Re: [Qemu-devel] [RFC 0/3] aio: experimental virtio-blk polling mode
Date: Wed, 16 Nov 2016 16:27:16 +0800 [thread overview]
Message-ID: <20161116082716.GA28320@lemon> (raw)
In-Reply-To: <90b5f81f-eab0-72dc-63b8-143477cb5286@redhat.com>
On Mon, 11/14 16:29, Paolo Bonzini wrote:
>
>
> On 14/11/2016 16:26, Stefan Hajnoczi wrote:
> > On Fri, Nov 11, 2016 at 01:59:25PM -0600, Karl Rister wrote:
> >> QEMU_AIO_POLL_MAX_NS IOPs
> >> unset 31,383
> >> 1 46,860
> >> 2 46,440
> >> 4 35,246
> >> 8 34,973
> >> 16 46,794
> >> 32 46,729
> >> 64 35,520
> >> 128 45,902
> >
> > The environment variable is in nanoseconds. The range of values you
> > tried are very small (all <1 usec). It would be interesting to try
> > larger values in the ballpark of the latencies you have traced. For
> > example 2000, 4000, 8000, 16000, and 32000 ns.
> >
> > Very interesting that QEMU_AIO_POLL_MAX_NS=1 performs so well without
> > much CPU overhead.
>
> That basically means "avoid a syscall if you already know there's
> something to do", so in retrospect it's not that surprising. Still
> interesting though, and it means that the feature is useful even if you
> don't have CPU to waste.
With the "deleted" bug fixed I did a little more testing to understand this.
Setting QEMU_AIO_POLL_MAX_NS=1 doesn't mean run_poll_handlers() will only loop
for 1 ns - the patch only checks at every 1024 polls. The first poll in a
run_poll_handlers() call can hardly succeed, so we poll at least 1024 times.
According to my test, on average each run_poll_handlers() takes ~12000ns, which
is ~160 iterations of the poll loop, before geting a new event (either from
virtio queue or linux-aio, I don't have the ratio here).
So in the worse case (no new event), 1024 iterations is basically (12000 / 160 *
1024) = 76800 ns!
The above is with iodepth=1 and jobs=1. With iodepth=32 and jobs=1, or
iodepth=8 and jobs=4, the numbers are ~30th poll with 5600ns.
Fam
next prev parent reply other threads:[~2016-11-16 8:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 17:13 [Qemu-devel] [RFC 0/3] aio: experimental virtio-blk polling mode Stefan Hajnoczi
2016-11-09 17:13 ` [Qemu-devel] [RFC 1/3] aio-posix: add aio_set_poll_handler() Stefan Hajnoczi
2016-11-09 17:30 ` Paolo Bonzini
2016-11-10 10:17 ` Stefan Hajnoczi
2016-11-10 13:20 ` Paolo Bonzini
2016-11-15 20:14 ` Fam Zheng
2016-11-09 17:13 ` [Qemu-devel] [RFC 2/3] virtio: poll virtqueues for new buffers Stefan Hajnoczi
2016-11-09 17:13 ` [Qemu-devel] [RFC 3/3] linux-aio: poll ring for completions Stefan Hajnoczi
2016-11-11 19:59 ` [Qemu-devel] [RFC 0/3] aio: experimental virtio-blk polling mode Karl Rister
2016-11-14 13:53 ` Fam Zheng
2016-11-14 14:52 ` Karl Rister
2016-11-14 16:56 ` Stefan Hajnoczi
2016-11-14 15:26 ` Stefan Hajnoczi
2016-11-14 15:29 ` Paolo Bonzini
2016-11-14 17:06 ` Stefan Hajnoczi
2016-11-14 17:13 ` Fam Zheng
2016-11-14 17:15 ` Paolo Bonzini
2016-11-15 10:36 ` Stefan Hajnoczi
2016-11-16 8:27 ` Fam Zheng [this message]
2016-11-14 15:36 ` Karl Rister
2016-11-14 20:12 ` Karl Rister
2016-11-14 20:52 ` Paolo Bonzini
2016-11-15 10:32 ` Stefan Hajnoczi
2016-11-15 18:45 ` Karl Rister
2016-11-13 6:20 ` no-reply
2016-11-14 14:51 ` Christian Borntraeger
2016-11-14 16:53 ` Stefan Hajnoczi
2016-11-14 14:59 ` Christian Borntraeger
2016-11-14 16:52 ` 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=20161116082716.GA28320@lemon \
--to=famz@redhat.com \
--cc=atheurer@redhat.com \
--cc=krister@redhat.com \
--cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.