From patchwork Fri Jun 14 09:48:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 251313 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 60E6E2C0085 for ; Fri, 14 Jun 2013 19:52:55 +1000 (EST) Received: from localhost ([::1]:53118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnQgf-0007fu-IK for incoming@patchwork.ozlabs.org; Fri, 14 Jun 2013 05:52:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnQd7-00023Z-W5 for qemu-devel@nongnu.org; Fri, 14 Jun 2013 05:49:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnQcy-0000iS-40 for qemu-devel@nongnu.org; Fri, 14 Jun 2013 05:49:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnQcx-0000iG-KB for qemu-devel@nongnu.org; Fri, 14 Jun 2013 05:49:03 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5E9n1KZ017298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Jun 2013 05:49:01 -0400 Received: from localhost (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5E9n01B017289; Fri, 14 Jun 2013 05:49:00 -0400 From: Stefan Hajnoczi To: Date: Fri, 14 Jun 2013 11:48:30 +0200 Message-Id: <1371203313-26490-11-git-send-email-stefanha@redhat.com> In-Reply-To: <1371203313-26490-1-git-send-email-stefanha@redhat.com> References: <1371203313-26490-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Paolo Bonzini , Anthony Liguori , Ping Fan Liu , Stefan Hajnoczi Subject: [Qemu-devel] [RFC 10/13] block: disable I/O throttling outside main loop X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 d986fc8..2d7a0f8 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 (*get_thread_aio_context() != qemu_get_aio_context()) { + return; + } + if (!qemu_co_queue_empty(&bs->throttled_reqs)) { qemu_co_queue_wait(&bs->throttled_reqs); }