From patchwork Thu Aug 2 14:50:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 10553919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8E3D13B4 for ; Thu, 2 Aug 2018 15:33:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A28B28D84 for ; Thu, 2 Aug 2018 15:33:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 987952C2B0; Thu, 2 Aug 2018 15:33:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2667A2909B for ; Thu, 2 Aug 2018 15:33:26 +0000 (UTC) Received: from localhost ([::1]:46359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flFbR-0000p1-Sn for patchwork-qemu-devel@patchwork.kernel.org; Thu, 02 Aug 2018 11:33:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flEwz-0004mF-U2 for qemu-devel@nongnu.org; Thu, 02 Aug 2018 10:51:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flEww-0001LE-QD for qemu-devel@nongnu.org; Thu, 02 Aug 2018 10:51:37 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:34120) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1flEww-00010p-DR; Thu, 02 Aug 2018 10:51:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=ldNVuAHhwYlbI3aS2mV1ysmgCcnbfFTF4bHRbChhUJQ=; b=GGnMFCDPmI41xzcks+Lg3sUHLO7xF0+yl6PpNACgVa6sTrJo+5WnWMFY9Sv4ZP45yA0hv+PYbCmnYGOxfjuOnrkSzwz0+HM5dJJmInANjPWZ7uLtNH6CH2nlW5fgoOXAQu9flNxMhdniRm6+WfRQWHxJtR4Y/vYYalDRw8gPXL0uiCQsHNhlgbqto4iRYAC4SnZuQDgpB9adCPDRDqcE+3L0UQHDqEAmInZsyDqslyk8FUsf5u+9st+j9VQYLn49ZGsYS8UEVgdNXbfYMQT02f/ZfnPvGbAol45dXodeg49o22KFqNXvERL6ha+c6Mjc3p7Ug2q0Tqg/2MBr3VqbPA==; Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1flEwJ-0006Dk-Ea; Thu, 02 Aug 2018 16:50:55 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1flEw0-0007aj-RX; Thu, 02 Aug 2018 17:50:36 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 2 Aug 2018 17:50:25 +0300 Message-Id: <8fb28f638bd31f509d0db800c3fd8e9874ef2caa.1533219143.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH 3/4] qemu-iotests: Update 093 to improve the draining test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , Stefan Hajnoczi , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The previous patch fixes a problem in which draining a block device with more than one throttled request can make it wait first for the completion of requests in other members of the same group. This patch updates test_remove_group_member() in iotest 093 to reproduce that scenario. This updated test would hang QEMU without the fix from the previous patch. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/093 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index b26cd34e32..9d1971a56c 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -225,15 +225,18 @@ class ThrottleTestCase(iotests.QMPTestCase): # Read 4KB from drive0. This is performed immediately. self.vm.hmp_qemu_io("drive0", "aio_read 0 4096") - # Read 4KB again. The I/O limit has been exceeded so this + # Read 2KB. The I/O limit has been exceeded so this # request is throttled and a timer is set to wake it up. - self.vm.hmp_qemu_io("drive0", "aio_read 0 4096") + self.vm.hmp_qemu_io("drive0", "aio_read 0 2048") - # Read from drive1. We're still over the I/O limit so this - # request is also throttled. There's no timer set in drive1 - # because there's already one in drive0. Once the timer in - # drive0 fires and its throttled request is processed then the - # next request in the queue will be scheduled: this one. + # Read 2KB again. We're still over the I/O limit so this is + # request is also throttled, but no new timer is set since + # there's already one. + self.vm.hmp_qemu_io("drive0", "aio_read 0 2048") + + # Read from drive1. This request is also throttled, and no + # timer is set in drive1 because there's already one in + # drive0. self.vm.hmp_qemu_io("drive1", "aio_read 0 4096") # At this point only the first 4KB have been read from drive0. @@ -248,7 +251,7 @@ class ThrottleTestCase(iotests.QMPTestCase): result = self.vm.qmp("block_set_io_throttle", conv_keys=False, **params) self.assert_qmp(result, 'return', {}) - # Removing the I/O limits from drive0 drains its pending request. + # Removing the I/O limits from drive0 drains its two pending requests. # The read request in drive1 is still throttled. self.assertEqual(self.blockstats('drive0')[0], 8192) self.assertEqual(self.blockstats('drive1')[0], 0)