From: Stefan Hajnoczi <stefanha@redhat.com>
To: Chao Gao <chao.gao@intel.com>
Cc: fam@euphon.net, pbonzini@redhat.com, qemu-block@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH] util/aio: Defer disabling poll mode as long as possible
Date: Thu, 4 Aug 2022 14:50:19 -0400 [thread overview]
Message-ID: <YuwU6xu7gq1Af3tC@fedora> (raw)
In-Reply-To: <20220710120849.63086-1-chao.gao@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]
On Sun, Jul 10, 2022 at 08:08:49PM +0800, Chao Gao wrote:
> When we measure FIO read performance (cache=writethrough, bs=4k,
> iodepth=64) in VMs, ~80K/s notifications (e.g., EPT_MISCONFIG) are observed
> from guest to qemu.
>
> It turns out those frequent notificatons are caused by interference from
> worker threads. Worker threads queue bottom halves after completing IO
> requests. Pending bottom halves may lead to either aio_compute_timeout()
> zeros timeout and pass it to try_poll_mode() or run_poll_handlers() returns
> no progress after noticing pending aio_notify() events. Both cause
> run_poll_handlers() to call poll_set_started(false) to disable poll mode.
> However, for both cases, as timeout is already zeroed, the event loop
> (i.e., aio_poll()) just processes bottom halves and then starts the next
> event loop iteration. So, disabling poll mode has no value but leads to
> unnecessary notifications from guest.
>
> To minimize unnecessary notifications from guest, defer disabling poll
> mode to when the event loop is about to be blocked.
>
> With this patch applied, FIO seq-read performance (bs=4k, iodepth=64,
> cache=writethrough) in VMs increases from 330K/s to 413K/s IOPS.
>
> Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Chao Gao <chao.gao@intel.com>
> ---
> util/aio-posix.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
I just noticed that I forgot to send a pull request with this for QEMU
7.1. It's my fault that this missed QEMU 7.1, sorry. It will be merged
once the 7.2 merge window opens.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2022-08-04 19:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-10 12:08 [PATCH] util/aio: Defer disabling poll mode as long as possible Chao Gao
2022-07-11 15:05 ` Stefan Hajnoczi
2022-08-04 18:50 ` 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=YuwU6xu7gq1Af3tC@fedora \
--to=stefanha@redhat.com \
--cc=chao.gao@intel.com \
--cc=fam@euphon.net \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--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 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.