[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/5] aio-posix: do skip system call if ctx->notifier
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PULL 3/5] aio-posix: do skip system call if ctx->notifier polling succeeds |
Date: |
Wed, 26 Sep 2018 10:55:24 +0800 |
From: Paolo Bonzini <address@hidden>
Commit 70232b5253 ("aio-posix: Don't count ctx->notifier as progress when
2018-08-15), by not reporting progress, causes aio_poll to execute the
system call when polling succeeds because of ctx->notifier. This introduces
latency before the call to aio_bh_poll() and negates the advantages of
polling, unfortunately.
The fix builds on the previous patch, separating the effect of polling on
the timeout from the progress reported to aio_poll(). ctx->notifier
does zero the timeout, causing the caller to skip the system call,
but it does not report progress, so that the bug fix of commit 70232b5253
still stands.
Fixes: 70232b5253a3c4e03ed1ac47ef9246a8ac66c6fa
Signed-off-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
---
util/aio-posix.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/util/aio-posix.c b/util/aio-posix.c
index c54d1ebfb1..621b3025d8 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -498,10 +498,11 @@ static bool run_poll_handlers_once(AioContext *ctx,
int64_t *timeout)
QLIST_FOREACH_RCU(node, &ctx->aio_handlers, node) {
if (!node->deleted && node->io_poll &&
aio_node_check(ctx, node->is_external) &&
- node->io_poll(node->opaque) &&
- node->opaque != &ctx->notifier) {
+ node->io_poll(node->opaque)) {
*timeout = 0;
- progress = true;
+ if (node->opaque != &ctx->notifier) {
+ progress = true;
+ }
}
/* Caller handles freeing deleted nodes. Don't do it here. */
--
2.17.1
- [Qemu-devel] [PULL 0/5] Block and testing patches, Fam Zheng, 2018/09/25
- [Qemu-devel] [PULL 1/5] aio-posix: fix concurrent access to poll_disable_cnt, Fam Zheng, 2018/09/25
- [Qemu-devel] [PULL 2/5] aio-posix: compute timeout before polling, Fam Zheng, 2018/09/25
- [Qemu-devel] [PULL 3/5] aio-posix: do skip system call if ctx->notifier polling succeeds,
Fam Zheng <=
- [Qemu-devel] [PULL 5/5] vmdk: align end of file to a sector boundary, Fam Zheng, 2018/09/25
- [Qemu-devel] [PULL 4/5] tests/vm: Use -cpu max rather than -cpu host, Fam Zheng, 2018/09/25
- Re: [Qemu-devel] [PULL 0/5] Block and testing patches, Peter Maydell, 2018/09/28