summary refs log tree commit diff stats
path: root/scripts/qapi/common.py
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2020-03-05 17:08:00 +0000
committerStefan Hajnoczi <stefanha@redhat.com>2020-03-09 16:41:31 +0000
commite4346192f1c2e1683a807b46efac47ef0cf9b545 (patch)
tree680aa83a68d728765ad7746d4eb9738726e40b92 /scripts/qapi/common.py
parentc39cbedb54fc49ba41cfe0af36570818025d281e (diff)
downloadfocaccia-qemu-e4346192f1c2e1683a807b46efac47ef0cf9b545.tar.gz
focaccia-qemu-e4346192f1c2e1683a807b46efac47ef0cf9b545.zip
aio-posix: completely stop polling when disabled
One iteration of polling is always performed even when polling is
disabled.  This is done because:
1. Userspace polling is cheaper than making a syscall.  We might get
   lucky.
2. We must poll once more after polling has stopped in case an event
   occurred while stopping polling.

However, there are downsides:
1. Polling becomes a bottleneck when the number of event sources is very
   high.  It's more efficient to monitor fds in that case.
2. A high-frequency polling event source can starve non-polling event
   sources because ppoll(2)/epoll(7) is never invoked.

This patch removes the forced polling iteration so that poll_ns=0 really
means no polling.

IOPS increases from 10k to 60k when the guest has 100
virtio-blk-pci,num-queues=32 devices and 1 virtio-blk-pci,num-queues=1
device because the large number of event sources being polled slows down
the event loop.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://lore.kernel.org/r/20200305170806.1313245-2-stefanha@redhat.com
Message-Id: <20200305170806.1313245-2-stefanha@redhat.com>
Diffstat (limited to 'scripts/qapi/common.py')
0 files changed, 0 insertions, 0 deletions