aboutsummaryrefslogtreecommitdiff
path: root/aio-win32.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-07-21 16:07:53 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2015-07-22 12:41:40 +0100
commit05e514b1d4d5bd4209e2c8bbc76ff05c85a235f3 (patch)
tree1768698d814f687fc322e365c672ddd94c14d55b /aio-win32.c
parent21a03d17f2edb1e63f7137d97ba355cc6f19d79f (diff)
AioContext: optimize clearing the EventNotifier
It is pretty rare for aio_notify to actually set the EventNotifier. It can happen with worker threads such as thread-pool.c's, but otherwise it should never be set thanks to the ctx->notify_me optimization. The previous patch, unfortunately, added an unconditional call to event_notifier_test_and_clear; now add a userspace fast path that avoids the call. Note that it is not possible to do the same with event_notifier_set; it would break, as proved (again) by the included formal model. This patch survived over 3000 reboots on aarch64 KVM. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Tested-by: Richard W.M. Jones <rjones@redhat.com> Message-id: 1437487673-23740-7-git-send-email-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'aio-win32.c')
-rw-r--r--aio-win32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/aio-win32.c b/aio-win32.c
index 7afc9992d6..50a6867458 100644
--- a/aio-win32.c
+++ b/aio-win32.c
@@ -338,7 +338,7 @@ bool aio_poll(AioContext *ctx, bool blocking)
}
if (first) {
- event_notifier_test_and_clear(&ctx->notifier);
+ aio_notify_accept(ctx);
progress |= aio_bh_poll(ctx);
first = false;
}