From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y20WU-0001WN-3Z for qemu-devel@nongnu.org; Fri, 19 Dec 2014 11:35:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y20WL-0002jL-09 for qemu-devel@nongnu.org; Fri, 19 Dec 2014 11:35:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y20WK-0002jB-PD for qemu-devel@nongnu.org; Fri, 19 Dec 2014 11:35:16 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBJGZGk6012416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 19 Dec 2014 11:35:16 -0500 From: Kevin Wolf Date: Fri, 19 Dec 2014 17:34:54 +0100 Message-Id: <1419006909-1781-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1419006909-1781-1-git-send-email-kwolf@redhat.com> References: <1419006909-1781-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 04/19] 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 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); -- 1.8.3.1