aboutsummaryrefslogtreecommitdiff
path: root/docs/sphinx/kerneldoc.py
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2025-03-07 23:16:34 +0100
committerKevin Wolf <kwolf@redhat.com>2025-03-13 17:57:23 +0100
commitee416407b3c0f45253779e98404acb41231a9279 (patch)
tree96058534ae7d563ba00e5dc6c78e56111a18c54c /docs/sphinx/kerneldoc.py
parentcf2e226fc654072acc185c5d7fb1ff77774f4563 (diff)
downloadqemu-ee416407b3c0f45253779e98404acb41231a9279.zip
qemu-ee416407b3c0f45253779e98404acb41231a9279.tar.gz
qemu-ee416407b3c0f45253779e98404acb41231a9279.tar.bz2
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>
Diffstat (limited to 'docs/sphinx/kerneldoc.py')
0 files changed, 0 insertions, 0 deletions