From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB1pl-0008Na-S8 for qemu-devel@nongnu.org; Tue, 13 Jan 2015 08:48:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YB1ph-0005uJ-Q3 for qemu-devel@nongnu.org; Tue, 13 Jan 2015 08:48:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB1ph-0005uD-Ja for qemu-devel@nongnu.org; Tue, 13 Jan 2015 08:48:33 -0500 From: Stefan Hajnoczi Date: Tue, 13 Jan 2015 13:47:41 +0000 Message-Id: <1421156896-11599-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1421156896-11599-1-git-send-email-stefanha@redhat.com> References: <1421156896-11599-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL v3 03/38] block: mark AioContext as recursive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Maydell , Paolo Bonzini From: Paolo Bonzini AioContext can be accessed recursively, in fact that's what we do with aio_poll. Marking the GSource as recursive avoids that GLib blocks it and unblocks it around every call to aio_dispatch, which is a pretty expensive operation. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- async.c | 1 + 1 file changed, 1 insertion(+) diff --git a/async.c b/async.c index 3939b79..572f239 100644 --- a/async.c +++ b/async.c @@ -300,6 +300,7 @@ AioContext *aio_context_new(Error **errp) error_setg_errno(errp, -ret, "Failed to initialize event notifier"); return NULL; } + g_source_set_can_recurse(&ctx->source, true); aio_set_event_notifier(ctx, &ctx->notifier, (EventNotifierHandler *) event_notifier_test_and_clear); -- 2.1.0