summary refs log tree commit diff stats
path: root/python/qemu/machine/machine.py
diff options
context:
space:
mode:
authorChao Gao <chao.gao@intel.com>2022-07-10 20:08:49 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2023-01-23 15:01:22 -0500
commit816a430c517eae48da5a31207ca43151df3203b0 (patch)
treeb11ef6a89c70073c8dc92cfa7fb93078bbc005a5 /python/qemu/machine/machine.py
parent00b1faea41d283e931256aa78aa975a369ec3ae6 (diff)
downloadfocaccia-qemu-816a430c517eae48da5a31207ca43151df3203b0.tar.gz
focaccia-qemu-816a430c517eae48da5a31207ca43151df3203b0.zip
util/aio: Defer disabling poll mode as long as possible
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>
Message-id: 20220710120849.63086-1-chao.gao@intel.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions