From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1GF1-0003xf-Dd for qemu-devel@nongnu.org; Wed, 17 Dec 2014 10:10:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1GEs-0002Vu-Br for qemu-devel@nongnu.org; Wed, 17 Dec 2014 10:10:19 -0500 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:51983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1GEs-0002Vk-5u for qemu-devel@nongnu.org; Wed, 17 Dec 2014 10:10:10 -0500 Received: by mail-wi0-f176.google.com with SMTP id ex7so16036000wid.9 for ; Wed, 17 Dec 2014 07:10:09 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 17 Dec 2014 16:09:58 +0100 Message-Id: <1418829000-20288-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1418829000-20288-1-git-send-email-pbonzini@redhat.com> References: <1418829000-20288-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] block: mark AioContext as recursive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com 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 --- 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