aio-posix: keep aio_notify_me disabled during polling
commit44277bf914471962c9e88e09c859aae65ae109c4
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 6 Aug 2020 13:18:02 +0000 (6 14:18 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 13 Aug 2020 12:34:14 +0000 (13 13:34 +0100)
tree0f121653a21378b00e3605f85e154ec486629f91
parent601829f88e0eff8f54fa08b7a69b0774a9c259c8
aio-posix: keep aio_notify_me disabled during polling

Polling only monitors the ctx->notified field and does not need the
ctx->notifier EventNotifier to be signalled. Keep ctx->aio_notify_me
disabled while polling to avoid unnecessary EventNotifier syscalls.

This optimization improves virtio-blk 4KB random read performance by
18%. The following results are with an IOThread and the null-co block
driver:

Test         IOPS   Error
Before  244518.62 ± 1.20%
After   290706.11 ± 0.44%

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200806131802.569478-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
util/aio-posix.c