You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/include/block
Kevin Wolf ee416407b3 aio-posix: Separate AioPolledEvent per AioHandler
Adaptive polling has a big problem: It doesn't consider that an event
loop can wait for many different events that may have very different
typical latencies.

For example, think of a guest that tends to send a new I/O request soon
after the previous I/O request completes, but the storage on the host is
rather slow. In this case, getting the new request from guest quickly
means that polling is enabled, but the next thing is performing the I/O
request on the backend, which is slow and disables polling again for the
next guest request. This means that in such a scenario, polling could
help for every other event, but is only ever enabled when it can't
succeed.

In order to fix this, keep a separate AioPolledEvent for each
AioHandler. We will then know that the backend file descriptor always
has a high latency and isn't worth polling for, but we also know that
the guest is always fast and we should poll for it. This solves at least
half of the problem, we can now keep polling for those cases where it
makes sense and get the improved performance from it.

Since the event loop doesn't know which event will be next, we still do
some unnecessary polling while we're waiting for the slow disk. I made
some attempts to be more clever than just randomly growing and shrinking
the polling time, and even to let callers be explicit about when they
expect a new event, but so far this hasn't resulted in improved
performance or even caused performance regressions. For now, let's just
fix the part that is easy enough to fix, we can revisit the rest later.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20250307221634.71951-6-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
1 month ago
..
accounting.h block: add accounting for zone append operation 2 years ago
aio-wait.h system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 1 year ago
aio.h aio-posix: Separate AioPolledEvent per AioHandler 1 month ago
aio_task.h block: Remove unused aio_task_pool_empty 7 months ago
block-common.h block: remove unused BLOCK_OP_TYPE_DATAPLANE 3 months ago
block-copy.h copy-before-write: allow specifying minimum cluster size 7 months ago
block-global-state.h block: Add blockdev-set-active QMP command 3 months ago
block-hmp-cmds.h include/block: Untangle inclusion loops 2 years ago
block-io.h block: remove outdated AioContext locking comments 1 year ago
block.h include/block: Untangle inclusion loops 2 years ago
block_backup.h include/block: Untangle inclusion loops 2 years ago
block_int-common.h qemu/compiler: Absorb 'clang-tsa.h' 2 months ago
block_int-global-state.h qapi: blockdev-backup: add discard-source parameter 11 months ago
block_int-io.h block: Mark bdrv_cow_child() and callers GRAPH_RDLOCK 1 year ago
block_int.h include/block: Untangle inclusion loops 2 years ago
blockjob.h Rename "QEMU global mutex" to "BQL" in comments and docs 1 year ago
blockjob_int.h block: Mark block_job_add_bdrv() GRAPH_WRLOCK 1 year ago
dirty-bitmap.h block: Mark bdrv_*_dirty_bitmap() and callers GRAPH_RDLOCK 2 years ago
export.h block/export: Add option to allow export of inactive nodes 3 months ago
fuse.h fuse: Allow exporting BDSs via FUSE 4 years ago
graph-lock.h qemu/compiler: Absorb 'clang-tsa.h' 2 months ago
nbd.h nbd/server: Allow users to adjust handshake limit in QMP 2 months ago
nvme.h hw/nvme: set error status code explicitly for misc commands 2 months ago
qapi.h block: Mark bdrv_get_parent_name() and callers GRAPH_RDLOCK 2 years ago
qdict.h qapi: Move include/qapi/qmp/ to include/qobject/ 2 months ago
raw-aio.h file-posix: Support FUA writes 1 month ago
replication.h replication: move include out of root directory 4 years ago
reqlist.h block/reqlist: add reqlist_wait_all() 3 years ago
snapshot.h block: remove AioContext locking 1 year ago
thread-pool.h thread-pool: Implement generic (non-AIO) pool support 2 months ago
throttle-groups.h block/throttle-groups: Use ThrottleDirection instread of bool is_write 2 years ago
ufs.h hw/ufs: Add temperature event notification support 2 months ago
write-threshold.h block: Clean up includes 2 years ago