From 0836c72f70143ba7d4277d89efc7643c526dd90a Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 13 Feb 2017 14:52:28 +0100 Subject: aio: push aio_context_acquire/release down to dispatching The AioContext data structures are now protected by list_lock and/or they are walked with FOREACH_RCU primitives. There is no need anymore to acquire the AioContext for the entire duration of aio_dispatch. Instead, just acquire it before and after invoking the callbacks. The next step is then to push it further down. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Reviewed-by: Daniel P. Berrange Message-id: 20170213135235.12274-12-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi --- util/async.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util/async.c') diff --git a/util/async.c b/util/async.c index 9cac702c5b..aec8016d42 100644 --- a/util/async.c +++ b/util/async.c @@ -114,7 +114,9 @@ int aio_bh_poll(AioContext *ctx) ret = 1; } bh->idle = 0; + aio_context_acquire(ctx); aio_bh_call(bh); + aio_context_release(ctx); } if (bh->deleted) { deleted = true; -- cgit 1.4.1