From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 76CFF8017D for ; Fri, 13 Nov 2026 11:18:24 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6ADBGA1U016635; Fri, 13 Nov 2026 14:16:11 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ADBGA1U016635 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="kE1KQqSU" Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6ADBFldw016573 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 13 Nov 2026 14:15:47 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ADBFldw016573 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4a20e41008cso5506165e9.1 for ; Fri, 13 Nov 2026 03:15:47 -0800 (PST) X-Gm-Message-State: APuU4Z/hVah+Htc3mpWCLv+ZFkfa/CA8O5xZ8fpscOGCgbpzKLOcAEWy imUBpTW7Dlt5AMkUP0l43IrlTFQpX6xyLU52AsF//qbHCd7NNEfkaZOXSc8IqCxG+mZ91pQJcJi yDc7GZr1zzdG7b3ygR2hm+bQquvsXS/jYkmzPoAE4bV8yzhdC6X4Aeg== X-Gm-Gg: AYBFou2g0YVf6S9EwBvVlmKBg6YHfgTv40Rvc1KVKwV3BaZgMxA5e1V3IclWQOKuKaO enY4gDFu6LfAn2ETCvidTPiedrbfXVQCsStM2Ul71TDww9zbiNg6PSnV9TXgg15MbcdWYJecNXq 5Be7MGJehXGLTE0hSE7EJGd8bskzjx5XWL7zUcaov7BInlMfNC/FGLOvq4wr4wSUUci2oQ4+86Q dWuo6oTpwZjQgTwODTB4zNsqUrM84Ql5MdoFKu/rpQ8WQT1akeZ2ft05KV5w4XI/tO++RAOPcKe bDtI279or70mc+FL09sK/YL4DOZjIB4Ow6GFrkFB4vtzxwwr56mVBK8bGHVePhRKRttfx7JsQ8i QSFHaiK2MvnCDuaocNNN5aW2A4Szb+w== X-Received: by 2002:a05:600c:608e:b0:4ac:da92:2bd4 with SMTP id 5b1f17b1804b1-4bb55a238bemr42792465e9.1.1794568546779; Fri, 13 Nov 2026 03:15:46 -0800 (PST) X-Received: by 2002:a05:600c:608e:b0:4ac:da92:2bd4 with SMTP id 5b1f17b1804b1-4bb55a238bemr42791945e9.1.1794568546216; Fri, 13 Nov 2026 03:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794568546; cv=none; d=google.com; s=arc-20260327; b=kx31SSbEUC32PLn3azyuyOJFK/8BNpyQFHX9m9kLjwydeRCCAgK8g/Ob6REAUSu9cp xdeXWkHg6NzGArqdlvCLq+XLdbP37TWRgbWl5ZgkytGFDeRdtMC11rTO0uKAPhA6u3IB UhczGndP0zuDebgfSVJ7UNWdm2yY4sXAG0HLbGFekRFxBeMynVKYSqlEQ/Vg4FVRyd2k 0qows4ctPsKQ0TkeASxjc8bNC5gUZ+B94PGy693YOKa/H4ZQgLF2QoSTGAZY6Gm1QbAh qXNtSRezF014nec6aKHd/wTHeCFcKsGC2dR0thLJGsP3Qa0GDKA90BR8ogGINwoPumua EULA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=JoyQ4g4ffgnS0945DLkjTbdg5FOMVhrjY2/y05tYUSo=; fh=ElTTnnNtphHTCCOZ+58STyaWac7y7ytLDJZIF4HMMJ4=; b=gjfd2yCLR+QF8nghH/PV8ZwBdYm9EjImiH2O0DKCURIpo6bQGhyftjyFR0bsjFAiQQ Tqmh8755sNaA64AM7lN/zAqq5RHYUCKssOazngLcCJwSnkpqMi36v6I5Q2vRarjilcdx ULwIK6ag+OVrG2PSKmTmieaCP0CctCjiSeOeyHguHEhfC+iYmOpBkeqgW85sdoUXUmLz kjF+3nD3MAkjFv24lc/SwQS0KOX77I24pMzdYw7vnivPQo2W5hUoG6fUXsoUMLaTBt/3 lz+vBtTPFHuB5/drrbtHVBLQcY44pBdj+euvyBskswSvOmmg6KE+hXCUzqIcL7eHcZeI vmaA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=kE1KQqSU; spf=pass (google.com: domain of andrey.zhadchenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=andrey.zhadchenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-49c637e3601si4949293f8f.211.2026.11.13.03.15.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2026 03:15:46 -0800 (PST) Received-SPF: pass (google.com: domain of andrey.zhadchenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=kE1KQqSU; spf=pass (google.com: domain of andrey.zhadchenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=andrey.zhadchenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=JoyQ4g4ffgnS0945DLkjTbdg5FOMVhrjY2/y05tYUSo=; b=kE1KQqSUSXUZ ETYzK0zsGalMAS9cYoYURDxt5Dk+n+h0YL4UnfrUpP2lLEx7xmbeMOUizEdmCySC6+ob4/ye5IKQQ JXL7405qzbkTvUmxpK1EfF7vqNjma9sAID3tLpS//Q98ZaD5c1sSMZDvfI/YDcMV0UySNcmfvbOzn KkPXq/D7USzDcAAGnPZUraMHKK/7W0Kg/ewLfyNYZteHd6drYiG2crU1BxXp6swHV1kWDbKvLYatI lbUe8gkFgjFj5cBWzNW6znevsKd7X8m6qRVwdPzz6SJjQ5g+N3o3TKpZPHDi3ZAhcLRExYdwQMZCk dxKgFUJr6Rt8roj/BlwoSw==; Received: from [130.117.225.5] (helo=vz9-demens-1.aci.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xRpBn-007Dd6-1V; Fri, 13 Nov 2026 12:15:42 +0100 From: Andrey Zhadchenko To: khorenko@virtuozzo.com, alexander.ivanov@virtuozzo.com Date: Fri, 13 Nov 2026 14:11:18 +0300 Message-ID: <20261113111126.793039-1-andrey.zhadchenko@virtuozzo.com> X-Mailer: git-send-email 2.43.5 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v3 0/8] dm-qcow2: per-qio fast path X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org dm-qcow2 processes every request sequentially in a single kwork. Unfortunately this introduces latency and cpu-bound limits. This patchset adds a fast path: right after splitting, qios which need no metadata changes are processed outside the main kwork, in parallel with it and with each other. These are: - reads and writes of fully allocated clusters; - reads of unallocated clusters, which are zero-filled or forwarded to the lower delta; - partial discards, which only punch a hole in the image file. Everything else (allocations, COW, compressed clusters, discards changing metadata, backward merge) still goes to the main kwork. Fast path qios are batched in per-cpu llists and processed by one work per submitting CPU, to avoid queue_work() cost on every I/O. The target also declares DM_TARGET_NOWAIT now, so io_uring submits I/O inline instead of punting every request to io-wq. Patch 1 fixes a race with md page insertion which already exists between qcow2_llseek_hole() and the main kwork, and which the fast path makes more likely. Patch 3 counts a fast path write or partial discard in md writers under the lock which checks its L2 entry, so a discard unmapping the cluster waits for it before the cluster is freed. Known limitation: fast path reads are not counted, and nothing pins their cluster between the L2 parse and the data submit. Main kwork may discard the cluster, free it and reuse it for another allocation in that window, and a fast path read then returns the data of another guest offset. A follow-up series fixes this: https://virtuozzo.atlassian.net/browse/VSTOR-154659 The fast path can be turned off at runtime with the fast_path module parameter. v2: - patch 2 waits for L2 writeback, so a fast path write is not acked before its L2 entry is on disk - batching goes before DM_TARGET_NOWAIT, and its worker no longer loops unbounded - measurements moved to the thread - subject prefix changed to dm-qcow2 v3: - rebased on the new hci-dev top, which includes "dm-qcow2: let discards of one L2 page wait for in-flight writes together" - "wait for L2 writeback in perform_rw_mapped()" is replaced with "count fast path writes in parse_metadata()": a write to an L2 index in flight goes to the main kwork at parse, and a counted fast path write or partial discard is waited for by a discard unmapping its cluster, instead of rechecking the L2 entry in perform_rw_mapped() - new patch: fast_path module parameter - md page lookup is repeated once only - the known limitation of fast path reads is described Details are in the patches. https://virtuozzo.atlassian.net/browse/VSTOR-95494 Andrey Zhadchenko (8): dm-qcow2: repeat md page lookup if it was inserted in parallel dm-qcow2: prepare process_one_qio() for fastpath dm-qcow2: count fast path writes in parse_metadata() dm-qcow2: add per-qio work infrastructure dm-qcow2: implement per-qio fast processing dm-qcow2: add fast_path module parameter dm-qcow2: process fast path qios in per-cpu batches on a workqueue dm-qcow2: declare DM_TARGET_NOWAIT drivers/md/dm-qcow2-map.c | 279 +++++++++++++++++++++++++++++------ drivers/md/dm-qcow2-target.c | 12 +- drivers/md/dm-qcow2.h | 16 +- 3 files changed, 257 insertions(+), 50 deletions(-) -- 2.43.5 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel