From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11021134.outbound.protection.outlook.com [52.101.65.134]) by lore.virtuozzo.com (Postfix) with ESMTPS id 7B1F8802A5 for ; Wed, 30 Sep 2026 11:17:54 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ktMeUT7OGlLhjXM69zXupNTnnv1mBfVaWuThn4V2R9byBlz3onTmlS7EpDbMLbhAmwLSwiRofUBXittz4IhvHHf1A5QQ081WLuK0m/x2LqafOaPs65w8+VVx03/B3onXyPINZnYXWq4WZxe83s1JhJpm4Ln47N8JYJdFyHOkbDq3yr/HZAxkFYXXUmhGnUMpPnPxGscVAwc91V79Ex2wesztrC+bC10Q7+0VVjbZHAfu8vaGqJZd7NgAHV9o3WtpUvriFTtOxbNQdiqZ8Y+qa5iYtDFjUj3TGS5gdzHcSZJJTKmRFZYV3kV3Zmou6Qwk3tRV0W6aHwPzmWQys4VNzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ouWyE0sO4695IFvLCrscylgkuBoJPt0FLKw0w+W9QNU=; b=I6B6gpBDePNzE24oLGKdOfRgXelWyYe6qze4dCgpi3W9YeJcP6NGoboynlv5ShV+wRWhTVSWKBLTsCL42ZTRhRTR5oLdWe/0t8TKgmuD7RzWtCbRUjjO7/yjvWSdfJoixB6+9WoTCQYgc2LEeSwKH75Irpot/Q2rckSRaI/6qVkv87J4I8g0xQz8NicwLRb9fLBLLK6OPtNCsO83HhJv0eAkPXXASyg0f+7ufJAi2h5oAbN+WaGYaTWhO+37/gPRjYZ2s6rWDYSJJRMGbtnXgUez5H2OG/Z37DGIu9rBbaMg8hIrvnCRegWxmDIziQHUt1HU8P6WZKCbdtuDhJXdaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 2a00:1450:4864:31::10) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=openvz.org; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=openvz.org; dkim=pass (signature was verified) header.d=openvz.org; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.onmicrosoft.com; s=selector2-virtuozzo-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ouWyE0sO4695IFvLCrscylgkuBoJPt0FLKw0w+W9QNU=; b=BbmAKHJTkfgKW2DQppShRE0mFyao8LlNVfsTdXCl6vPwkbIbuYPQNafmRA7pqcNrhZclc1syjvJ7UM0DzR1eQungxtC2LOtTJlop9qrDuKm5Nr67rwIwAX1e1ZvZdeiUZJNBSUjX3n0XNQPCpIVgwYoUYHsPE+5+Tosdk+wvoig= Received: from DB9PR02CA0015.eurprd02.prod.outlook.com (2603:10a6:10:1d9::20) by AMDPR08MB999893.eurprd08.prod.outlook.com (2603:10a6:20b:70c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.472.14; Wed, 30 Sep 2026 11:17:51 +0000 Received: from DB1PEPF000509E5.eurprd03.prod.outlook.com (2603:10a6:10:1d9:cafe::63) by DB9PR02CA0015.outlook.office365.com (2603:10a6:10:1d9::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.15 via Frontend Transport; Wed, 30 Sep 2026 11:17:49 +0000 Authentication-Results: spf=pass (sender IP is 2a00:1450:4864:31::10) smtp.mailfrom=openvz.org; dkim=pass (signature was verified) header.d=openvz.org;dmarc=pass action=none header.from=openvz.org; Received-SPF: Pass (protection.outlook.com: domain of openvz.org designates 2a00:1450:4864:31::10 as permitted sender) receiver=protection.outlook.com; client-ip=2a00:1450:4864:31::10; helo=mail-wm2-x10.google.com; pr=C Received: from mail-wm2-x10.google.com (2a00:1450:4864:31::10) by DB1PEPF000509E5.mail.protection.outlook.com (2603:10a6:18:3::617) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.14 via Frontend Transport; Wed, 30 Sep 2026 11:17:47 +0000 Received: by mail-wm2-x10.google.com with SMTP id 5b1f17b1804b1-49fff6f0f87so25684105e9.3 for ; Wed, 30 Sep 2026 04:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1790767067; x=1791371867; darn=virtuozzo.com; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ouWyE0sO4695IFvLCrscylgkuBoJPt0FLKw0w+W9QNU=; b=ScWiDxKvm5vLbLve3ShXjM9IZopKMEaXBb5aoKC3AmovsDpxe/g9IeyZFeha3gCG7P oLacQa4dVryszicajYezuA0WjOvwXuGmnXgr+uUujI6T/wfbgfkuRGkOQELk9xKwE5Qv XVfEaUr3tHu8TCXvUGqFwlKMOa+TwMuZizxYCgYAvPVH/8Dk1WLs18NO92LF+zJOPrjq G4ZnY17dNDguT7UktX8fBiE8Y6LcJzfI9hT8xIgY7JxhJ2wY3mqHXAYkrC66t7dGMW9J F3oeHOyCxXD9sz24I2tZcNLR1Qje4fsDM7lpSM0WArehBLjQVB8k3JSel69qfcnaMUP3 Gg8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790767067; x=1791371867; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ouWyE0sO4695IFvLCrscylgkuBoJPt0FLKw0w+W9QNU=; b=yqaNQHiblHsqhvdzPOJ1aI4Z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.7.1790767067126; Wed, 30 Sep 2026 04:17:47 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:c6b8:98e2:93f0:2de6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a01cd002bcsm3092365e9.4.2026.09.30.04.17.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2026 04:17:46 -0700 (PDT) From: "Denis V. Lunev" To: svt-core@virtuozzo.com Cc: andrey.drobyshev@virtuozzo.com, den@virtuozzo.com Subject: [PATCH hci-8.0 0/9] block: cheaper zero handling in backup and commit #VSTOR-134085 Date: Wed, 30 Sep 2026 13:17:30 +0200 Message-ID: <20260930111739.3866427-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509E5:EE_|AMDPR08MB999893:EE_ X-MS-Office365-Filtering-Correlation-Id: c432a806-5c4e-4702-b336-08df1ee47559 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 0 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704161411799003|6059299003|82310400026|61400799027|376014|43022699015|48200799018|9140799003|55112099003|18002099003|16102099003|13003099007|5063699009|56012099006|10067099003; X-Microsoft-Antispam-Message-Info: QTBXIG4ffYmrFPGnfl78+vVGkhlrQQRKgaAXm9tkRFidX0P7NKzn9LAiC4WBPRNh5t8CLd1x0eb3XA6RTCFYNUrz2lOu0syOOmGjlfz0GncuinfzAU3jcQbIXPHb5tb3VzVdyWFehmJw2S5ZJQbzrx28AuPH/FB/3wvGY0h5Jo7sGbMXNX7i0wy1U1kws7nKqDYZrRiWeChJqyUBzBPDNF7aB2Ybl7wgQIhSkgmf8SKdGtBI/8SeEF/USnQXlQvJVBDxbwudsJcfwcqcnLjZXRRCj4mWel/Bwpnd2Xp+Wn58B0fgg2sekuXE7CtDF/VU+Rvb7/8xNOh9oJWia1RLs5MeBM6wMvZlTzQLFBHWBHIyrxWzWX95nauqvjKK+NM4NI3nvO00bkuxlOBL697hDyVwQxIt3RJB+WJxs1BXi9M9kU4O2Eu49Xnd6I5yAHBwNvAjxtfhoCmfp2/m0arrcMwOlWCGUpbo4PDMFNVKxuok+TwauYAunshSAnTmGem0Y/Q33+Ko/sUXswJt5nM/CFjM/cpHLKF5cFc/GfST45mB895A2Y9WBOR+wiMGM6WX7jookSa4Yo+hrcJK8B/NyOyDRXrWngMJVehrpSgQvytsR4sMInaSMmNWLgKg/AZhOG180v0+4k2C08/EeZNAEILTx8rlrkFzn8aFIeI2tmvGDH6EY80KYMv9tVj+03MbfI+rofeSJ5tB1omSOvbDu3fVDue8H9bc4teGJwnz2qr+vLKGjZ4KcF1KEcQqfRtUu/wAupvpCEskfzyh1bbW3sS2FrgxIheGA+YG2k+77U2Ts5DsYOZHTguZs8nmhHSpKutl42wbghRCsjm5VzHpdw== X-Forefront-Antispam-Report: CIP:2a00:1450:4864:31::10;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail-wm2-x10.google.com;PTR:mail-wm2-x10.google.com;CAT:NONE;SFS:(13230040)(704161411799003)(6059299003)(82310400026)(61400799027)(376014)(43022699015)(48200799018)(9140799003)(55112099003)(18002099003)(16102099003)(13003099007)(5063699009)(56012099006)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 83HzoNpCFTM30imnzOpL3t5oVtxas1sV9RluBjlIlpJn+BSTkdjfOP4SgYjLV/h+zbcUCyJN2Z08ogNpFWDhEOGoxVLr1gqd1FhES0HQptAlurJhlc6GcAfH/yRzshTCWnGfko6MYCEXx3iaffDniiqPLj7CtTX28bo1RMpERSkcPjZ7u6Oy6Sz8NeBK8U7AXF8pMkvHy/nV3J6sPaO9VovcgTrFkOE3P8JptYsRUHMOZiZmtAMSVngjfo8aJxXrgU1So8dpdu0o5G8XqtUw2TizlqXPqBBVncyFif7mXPr9gT7W8pz/65tR4JF0NcrRdf+hsRsm2UAb4ZYzP0eqzPaHSsKY7Xy0FgekqjJG4+ugbhovvVSw1d4Ub4eOqJJJ/B9rbfeZuUKZ+MJp1CzIdvfBlbEOwKRFYKXr87hTHyJzkRyne/LUCxEcuR8cY9I2 X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2026 11:17:47.9127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c432a806-5c4e-4702-b336-08df1ee47559 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509E5.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMDPR08MB999893 List-Id: Backup and commit re-query the source block status for every task and size a task by the copy buffer, so a long run of zeroes turns into a crowd of small write-zeroes requests. This series reuses what the up-front scan already learned and lets one write-zeroes task cover a whole run. This is the series posted upstream as v3, all nine patches with Andrey's Reviewed-by: https://lore.kernel.org/qemu-devel/20260929155125.3151111-1-den@openvz.org/ hci-8.0 carries 6b1a4754713 ("backup: skip copying unallocated for full mode"): sync=full runs the same up-front scan as sync=top, drops the clusters the source never allocated, and keeps skip_unallocated set afterwards, taking the block-status base from a separate top_mode flag. So the upstream cover letter case, a mostly unallocated image, is already cheap here. What the series buys on hci-8.0 is allocated zero clusters, the ones a guest write-zeroes or detect-zeroes leaves behind, in sync=full and in sync=bitmap, and the commit job. Where the port differs from upstream, 4/9, 7/9, 8/9 and 9/9 say so in an "hci-8.0:" paragraph: - 3/9: only a context conflict. hci-8.0 lacks upstream a6c131217d, which adds coroutine_fn to commit_iteration(), so the signature stays as it is here. - 4/9: iotest 124 expects a sync=full target to keep the source's holes, since the unallocated clusters are skipped rather than written as zeroes. - 7/9: block_copy_status_base() keys on top_mode instead of skip_unallocated, and the scan uses it too instead of computing the base on its own. - 8/9: sync=full stays on block_copy_reset_unallocated(); only sync=bitmap moves to block_copy_calculate_zero_bitmap(). - 9/9: 6b1a4754713 also made the 056 copy-before-write source read as zeroes. One widened write-zeroes task now covers all of it before speed=1 can hold the job, so the test caps the task with x-perf max-chunk. Andrey, the 4/9 and 9/9 test changes are new with this port and not covered by your upstream review. Every patch builds on its own. On dev007 with qcow2, iotests 040 055 056 124 129 141 185 219 257 image-fleecing backup-discard-source copy-before-write commit-zero-blocks iothreads-commit-active and migrate-during-backup pass. vz-kernel-cbt fails there with and without the series, the host kernel has no vz CBT. On the same host, a 16G qcow2 source holding 1G of data, raw target on ext4, counting block_copy_process and commit_one_iteration trace events: before after sync=full, 15G unallocated 1024 0.44s 1024 0.44s sync=full, 15G zero clusters 16384 0.66s 1032 0.46s sync=bitmap, all dirty, same 16384 0.65s 1032 0.46s commit, 15G zero clusters 32768 2.84s 2288 2.70s Commit time is dominated by copying the 1G of data. Denis V. Lunev (9): block/commit: pass BDRV_WANT_PRECISE to block-status #VSTOR-134085 iotests/040: cover large and fragmented commit runs #VSTOR-134085 block/commit: batch block-status queries #VSTOR-134085 iotests/124: cover backup of zero clusters and holes #VSTOR-134085 block/block-copy: don't reserve memory for zero tasks #VSTOR-134085 block/block-copy: extract block_copy_set_task_method() #VSTOR-134085 block/block-copy: track known-zero source clusters #VSTOR-134085 block/backup: pre-fill zero_bitmap for full/bitmap #VSTOR-134085 block/block-copy: coalesce write-zeroes tasks #VSTOR-134085 block/backup.c | 94 ++++++---- block/block-copy.c | 309 +++++++++++++++++++++++++++----- block/commit.c | 59 +++++-- include/block/block-copy.h | 5 + tests/qemu-iotests/040 | 102 ++++++++++- tests/qemu-iotests/040.out | 4 +- tests/qemu-iotests/056 | 3 +- tests/qemu-iotests/124 | 350 ++++++++++++++++++++++++++++++++++++- tests/qemu-iotests/124.out | 4 +- 9 files changed, 830 insertions(+), 100 deletions(-) base-commit: f2f4b3de1a1be3360a77ca6ab79762466d238804 -- 2.53.0