From nobody Mon Feb 9 00:55:21 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1595879297; cv=pass; d=zohomail.com; s=zohoarc; b=KgRg4zR1uPyiZo5XK0j3yAZ+RuE+4ArSZv4hLSP5TUGNi7W7YgtghMFzGgJ7F7OWqkIPzpvx7zUygKdk7IzpZ9wWwvDVEV9NFb53nk75QVAzI7G4fdsncOJwiCMTD43QmM/41k7tL2hW9pRP9uiaUgaX+8PcFom8+y4dhGkAl4k= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595879297; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tl486APdJgMxQD8NFBHBW3Xh3Bwx2Gw0wiffDVVWwT8=; b=FgAvoZXH2DXcwoIgt7aOTwQQv47JXYX+8jIUbgFgikidRmvePkA9BuqJcONPu0jHubkT4GCT0goLHH0rnc0YfWKh80UAClEca7urVCEh3W8sF+LPlp3dZ7J74ZyqgnZuHmL3R3fwEFyXAR7Fs9IbUlv+X5KKX6CLrbQS7tmX2Ps= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1595879297068308.9296710736927; Mon, 27 Jul 2020 12:48:17 -0700 (PDT) Received: from localhost ([::1]:55018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k096d-0001vE-Oo for importer@patchew.org; Mon, 27 Jul 2020 15:48:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k091c-0001l1-0q; Mon, 27 Jul 2020 15:43:04 -0400 Received: from mail-eopbgr80131.outbound.protection.outlook.com ([40.107.8.131]:43617 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k091Z-0003fa-5L; Mon, 27 Jul 2020 15:43:03 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM5PR0802MB2610.eurprd08.prod.outlook.com (2603:10a6:203:97::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Mon, 27 Jul 2020 19:42:53 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::8c0c:c056:97a5:484a]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::8c0c:c056:97a5:484a%4]) with mapi id 15.20.3216.033; Mon, 27 Jul 2020 19:42:53 +0000 Received: from kvm.sw.ru (185.215.60.158) by AM0PR05CA0084.eurprd05.prod.outlook.com (2603:10a6:208:136::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20 via Frontend Transport; Mon, 27 Jul 2020 19:42:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dyYR2yx6btD3Wd45R2d6/QjQmXmRBBR8tPmYXDWHbpX8U3E7LMR2IiCPT3eKUkF1vV72sAFcupF0AsWMquymlgVIWyFIp2ReQV0ndKOvjgH+jj+Xtd7HVdPpHlT+W7gUfPTEovGLOl4GJ+9wx3Jx2T8KgIa/IKB5QTH9pQ2HA1p+/tctWVpC6Q8VVWrpRZ7jn/N+hm30noBqdAgg5aMIbxaDYqQnXpCOQ3rAqWuwj18TZ/8FdTbel7mshcHD0Z7NlwS49qdRIwIQnCiWEAmzcGitQZMPQn3VjxMutTOPeFne3wzkvJNo2BlA+EA+PNEh6eT7bdhF/nms2ymitdvNQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tl486APdJgMxQD8NFBHBW3Xh3Bwx2Gw0wiffDVVWwT8=; b=iwKML51Ic7Vic1w3MKiMLUTR7VvE4se0ErazU09Wu1j69oru68nwBlgYmpyfDLa4cKfIxo2xO/aTNvFQ2R/O/Zo56kRjVxZEE74JZ/zvS2Cz0AjqrZr9alVmIy5x0RiMAuK83XC5u0lf8awrwLBQ33uLxPr0f215pjcfILJumoA7d3EHQgJSv+oMNVp0acB1DJwc1l5i8Im19KWfR7B/btO2D199GZaHBMeSXjW6waABnOiSHMrsJnzP37+opMf8xUoKYftAXUq3fi37OFH9awVmFTCJQ/XvP7Kk3ep+hR9ELchZp404erpAPhstKN85Cz8QdICcUmZbof64RprD/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tl486APdJgMxQD8NFBHBW3Xh3Bwx2Gw0wiffDVVWwT8=; b=HlAthsCiekne+TV4KIkAd4uY1wqfjHaGTUpn7ssE4fQcI1MAi09RQx9SIcGqT2Z7JNuid0pI66rhI2P6PnuzMruV7KP3v4eLH6fDcTxyKrZhX2h74XTMq/82F4IMiESZ9hdIxmjcv/iIGg/gt1tleQrRwLq0UGjhiPiyEXHOEes= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v4 04/21] qemu-iotests/199: improve performance: set bitmap by discard Date: Mon, 27 Jul 2020 22:42:19 +0300 Message-Id: <20200727194236.19551-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200727194236.19551-1-vsementsov@virtuozzo.com> References: <20200727194236.19551-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR05CA0084.eurprd05.prod.outlook.com (2603:10a6:208:136::24) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.158] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0a82433-b2cb-4b6b-c6a7-08d8326540e1 X-MS-TrafficTypeDiagnostic: AM5PR0802MB2610: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:14; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zQxwmvV3LBJtLBqquAhaeYArDzR5leKj0UJ6BiGyqHOFfH03IS2LPzZtNcEg8LnSRxE+sf9ZaXHh9DMqOu2A0Q5h17r1txi1hUczkpWJhUbvFWeYA48H/1+8Ns7UBgvjozGNlvjn47WDdDQxbdWU756UoTF8zPvRYsMCEuhfV5pAC2xfx2IfQC913JsjSz7MS0P4aqTlS6IDtn5oM18iRtI2BCinuQ4CqPyLWVnM3nX9L4bqSKY3ydDXyVPlNWEWqYBdu4ZzhVNtv5HSISHz9wC1A9ZhXt59mmNAh4f5yNrghlHgtVN/HZsb3zx/0y9ts10Y3/uJKH5msy88wgKXhQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(366004)(376002)(39840400004)(346002)(66556008)(1076003)(66476007)(6512007)(107886003)(86362001)(36756003)(52116002)(4326008)(26005)(2616005)(2906002)(66946007)(8676002)(7416002)(16526019)(6666004)(316002)(6916009)(6486002)(956004)(83380400001)(6506007)(5660300002)(478600001)(186003)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Dhjx00l+Cgg7bnSwoodzTzTkzZGAVJ0XC/ZZX8JVl1THq1zFnh3MRzhuKr6YTq4HfkemWoWzHKuZgIkLJ0csWz9P3WO82odp2x1lqHTjYLgXLHYZl7u5dbP8LhB2PrSt5+52YXN1rmcMyfjWQbM+sIF5MARLzIUDeSk2u2OF4cLjck9thyod7v08XqwKg3RJXp9qcQrNDBdbQSkGnWojdTYJ1rfP/2O6jWvUXC/+Hdc2StYSgi2Hxd3e7ydcqLkfrJGTwHZfhgv1J6/cRuk6OI8ceeMs8ld+YedXoR5ucF0Axr8PcCdXsPqCSMOnhg5itsRPgLOcCC4hCQXDZn+zgjTqKsCvN2PrzQ8RpTikxs0eOvCq83NGrcHc0A5qB+jqa8ePaCTgEjb8GUm3kaWrwztfmjbbnkacKlYJYfa8r7dYAvuiCzBD3CyZ8IUFF2sN4cxrN47UicuqyBQgCmRkDAg8MNqyR3elWUN45TEa+ko= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0a82433-b2cb-4b6b-c6a7-08d8326540e1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2020 19:42:53.6440 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6Dt5teHoQYjCIVhU06hw9SK0lrzRAwRVRXGFvAHvMhi+1GRFCxVtTRIJc3hJ3oPAWmOOxf8/siH9xx/lw/MGzndycBoaIsnN9KPo1c+yQ9c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2610 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.8.131; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/27 15:42:50 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com, quintela@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, stefanha@redhat.com, Andrey Shinkevich , den@openvz.org, mreitz@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" Discard dirties dirty-bitmap as well as write, but works faster. Let's use it instead. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Tested-by: Eric Blake --- tests/qemu-iotests/199 | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199 index dd6044768c..190e820b84 100755 --- a/tests/qemu-iotests/199 +++ b/tests/qemu-iotests/199 @@ -67,8 +67,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCa= se): os.mkfifo(fifo) qemu_img('create', '-f', iotests.imgfmt, disk_a, size) qemu_img('create', '-f', iotests.imgfmt, disk_b, size) - self.vm_a =3D iotests.VM(path_suffix=3D'a').add_drive(disk_a) - self.vm_b =3D iotests.VM(path_suffix=3D'b').add_drive(disk_b) + self.vm_a =3D iotests.VM(path_suffix=3D'a').add_drive(disk_a, + 'discard=3Dunmap= ') + self.vm_b =3D iotests.VM(path_suffix=3D'b').add_drive(disk_b, + 'discard=3Dunmap= ') self.vm_b.add_incoming("exec: cat '" + fifo + "'") self.vm_a.launch() self.vm_b.launch() @@ -78,7 +80,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCas= e): self.vm_b_events =3D [] =20 def test_postcopy(self): - write_size =3D 0x40000000 + discard_size =3D 0x40000000 granularity =3D 512 chunk =3D 4096 =20 @@ -86,25 +88,32 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): name=3D'bitmap', granularity=3Dgranularity) self.assert_qmp(result, 'return', {}) =20 + result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive0', name=3D'bitmap') + empty_sha256 =3D result['return']['sha256'] + s =3D 0 - while s < write_size: - self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk)) + while s < discard_size: + self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) s +=3D 0x10000 s =3D 0x8000 - while s < write_size: - self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk)) + while s < discard_size: + self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) s +=3D 0x10000 =20 result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', node=3D'drive0', name=3D'bitmap') sha256 =3D result['return']['sha256'] =20 + # Check, that updating the bitmap by discards works + assert sha256 !=3D empty_sha256 + result =3D self.vm_a.qmp('block-dirty-bitmap-clear', node=3D'drive= 0', name=3D'bitmap') self.assert_qmp(result, 'return', {}) s =3D 0 - while s < write_size: - self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk)) + while s < discard_size: + self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) s +=3D 0x10000 =20 caps =3D [{'capability': 'dirty-bitmaps', 'state': True}, @@ -126,8 +135,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): self.vm_b_events.append(event_resume) =20 s =3D 0x8000 - while s < write_size: - self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk)) + while s < discard_size: + self.vm_b.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) s +=3D 0x10000 =20 match =3D {'data': {'status': 'completed'}} --=20 2.21.0