From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyk0t-0001NN-Eg for qemu-devel@nongnu.org; Mon, 15 Jul 2013 10:44:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uyk0q-0002DF-Qs for qemu-devel@nongnu.org; Mon, 15 Jul 2013 10:44:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyk0q-0002CJ-Jp for qemu-devel@nongnu.org; Mon, 15 Jul 2013 10:44:28 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6FEiRQA012276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Jul 2013 10:44:27 -0400 From: Stefan Hajnoczi Date: Mon, 15 Jul 2013 22:42:59 +0800 Message-Id: <1373899382-13514-11-git-send-email-stefanha@redhat.com> In-Reply-To: <1373899382-13514-1-git-send-email-stefanha@redhat.com> References: <1373899382-13514-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH v2 10/13] block: disable I/O throttling outside main loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi Timers only work in the main loop. This means threads running their own AioContext cannot use I/O throttling for now. Signed-off-by: Stefan Hajnoczi --- block.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block.c b/block.c index 26644ec..daf5717 100644 --- a/block.c +++ b/block.c @@ -169,6 +169,11 @@ static void bdrv_io_limits_intercept(BlockDriverState *bs, { int64_t wait_time = -1; + /* Timers currently only work in the main loop */ + if (*tls_get_thread_aio_context() != qemu_get_aio_context()) { + return; + } + if (!qemu_co_queue_empty(&bs->throttled_reqs)) { qemu_co_queue_wait(&bs->throttled_reqs); } -- 1.8.1.4