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 87985811BB for ; Wed, 4 Nov 2026 21:36:55 +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 6A4LZgCK027076; Thu, 5 Nov 2026 00:35:43 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4LZgCK027076 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="b2GJ7Wrb" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A4LZFZH027023 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 5 Nov 2026 00:35:16 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4LZFZH027023 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-4915ba023d4so12814f8f.0 for ; Wed, 04 Nov 2026 13:35:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBzorqwSvRy6YLqMgcyOZzEv3kXGuG47U83sseo1yACgThDX83KOQFiKRJ3bhZ5hKISRbfEt/A==@openvz.org X-Gm-Message-State: APuU4Z84i+U1DMluuPrNtorndN882XuOVItIkrmPZ8y3q6jyW5ETs6f3 /gJOVl6Bckeb0U8bKudjSi7LB+H/q/7qDorEOMtO9CdDOQY6ABOfMQA8KwaRBhwwVmeNLVK7FAV k55k8Y8/4hw1BCpSVjuI5E3s59Cztcc4pDGbdISJsEUKxqUJg+6LQ/Q== X-Gm-Gg: AYBFou2zQomlqWN2EVYRN6da0Y3ZIHMy5ylDmQ2mYjF+bVkUtYzC4eTAvX9AbQfl+k7 4yAijawM+/2jHng+gV0uLY8QW12AGmDuo7uxOWV6wXJuu2BQ3JY1E8YbHvCM0MYxjMPG1wVrKxG hfZYM6qmoh/joaLX3NeCbzD+lNsC0b2cVqj056yfEae4ijegjZN5NO5lekL8jIF5/j+FvvzUFe1 qQw260xD80fkDYFUfIv44UnSIPhTWQppicmHAnZjHtsKYN3Z+PeXPOWac1vyuRnCuHFvWSNe5SH NBLrZVTb72eg7nii2kl/FmDITyraJzRCKKBvGRoAMQXb1o3avyYUC/vRCE7bLAxkQ0xKSJQkELa EjrDm+u8GcIAwSCwBgQ== X-Received: by 2002:a05:6000:4311:b0:48e:20ed:d5e7 with SMTP id ffacd0b85a97d-48e6e2ff167mr35578086f8f.34.1793828115754; Wed, 04 Nov 2026 13:35:15 -0800 (PST) X-Received: by 2002:a05:6000:4311:b0:48e:20ed:d5e7 with SMTP id ffacd0b85a97d-48e6e2ff167mr35578066f8f.34.1793828115312; Wed, 04 Nov 2026 13:35:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793828115; cv=none; d=google.com; s=arc-20260327; b=Jk/p40aL0S5iBGz9CVp48VZvVq+fGHRkDKCiamzw900DBZFEFaAyfQi6cLpw8rTBa1 nXEhahdCkc1M2kEFVmW1YK5gdUgCNLmzgzQChaQ6z4/824LsHI8TIqu0NliOLo5GzRfI +3V19L4vDcNbcU5duZQgi+T1r1NzUuDLAAQJZxLC/ZsLS1CxK7liebdECG7NCUaa+UEg UA/optoSSvt0i58Pokf95NXWJ+xe8B/Ris77SQEK0O63m52+scIE6UOaf0YzO2RqSxkz lwXhWmAkWI1HPQcI+nkTvZLNo4PymJ2BrYDCfQw36ioMyR8kn0PvSEW8ClF65Xf/Pyb+ nBtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=VjdrL03SS7pkbhBCsqapERKY16He7CXcXJT19w0gDn0=; fh=wM93IzJ1q6YTmltzeth+TON77Ag69AF1TepZ24u7du4=; b=KVmbHWP34ya3ov5/0KqSkB1V5cdGpgCLszKamM+5VE85qrZVT52MfXqWPGUAcISioy Go/ugUHNHevvMhMgzchxQ6RLG9qhttw+t9uIWgMQjMyuJeWqnCFcikx8kDblo/m5xESJ aiyg8pgtxq0TJ+tw5gfNcEM6hBCNxW3L+JnWQJ+hUYqyKaQ9LNoSifiFzCXqsGPZ+BaU QSjRZQD2ST9id6WTvp8X8KIQa34+6oQCv1IsPIvA5w/72rflUDf7Nm/DyKIsfFqc1VXK CoLGxRLYC1xpkMISXnEbj9RF+iCGMw0Nv6qpQg1fWJHbcDPF5W/o4wOFSyTFFcMH1IIZ 3hNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=b2GJ7Wrb; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@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-48fedd000a7si6154831f8f.220.2026.11.04.13.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 13:35:15 -0800 (PST) Received-SPF: pass (google.com: domain of khorenko@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=b2GJ7Wrb; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@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=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=VjdrL03SS7pkbhBCsqapERKY16He7CXcXJT19w0gDn0=; b=b2GJ7WrbM/AF sjqLrJFt6V1Xvzm6+bTjxrJpiqYyva1lQxewt5x5kNriFCuBNIbkSkS/jzHPNtHYKJBCJ75/pPEOi Rx7YWZ1umOfM4G05n2kWjViLjL8AfMmHEK862DmpDXH3kq8XnfTyZ0YpLuDoXbRqmHdwqgqRx7uEq uk5synHJir3zLSYVfitJXzmRPhOyFytiP43TRUwt7RadTCWHOf0rnT304GXzVsaDCUyHkmjMwslld ynkLW/9iXEhUC7qfJo3VSMglOFRPzd6HbCaW8MApOMRgJTUGtY8yEDwQxMXE1Pnxyq+FumxqAiTkl h9iVmFT1riHWjjR7eix8qA==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xOiZZ-00248s-2P; Wed, 04 Nov 2026 22:35:13 +0100 MIME-Version: 1.0 From: Konstantin Khorenko To: Andrey Zhadchenko In-Reply-To: <20261029140346.465768-8-andrey.zhadchenko@virtuozzo.com> References: <20261029140346.465768-1-andrey.zhadchenko@virtuozzo.com> <20261029140346.465768-8-andrey.zhadchenko@virtuozzo.com> Date: Wed, 04 Nov 2026 22:35:09 +0100 Message-Id: <179382810904.2794215.16266433689771992448.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1788; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=J35Jdp0xOFQW0l25PbVTbT+wtISZbGbQBAiv0uhBXjU=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq66URYK0VYuSUpUdaLx7zRrhSDpljjs+QfRQje tbg+lmLal6JAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCauulEQAKCRBRlgpH+WFc KlrxD/wPD3uvg6XBTzH+39Uq0yHIpTESUAuPi8XPeL00Kf+yO2LvOytlJkPBi8SP6wx2bZfty0J Z+N7jQjSUjVd9S7hAUjbOTHBTI053GyDKiMws8h+QJDzUdqSO5gvI9YUEN4E7tE3O/CzyJJyPXw fnah8wv4iH/MvXJunoPngkWeiPefJ8HrmN7cH2RO8LLQvVcgZhv5lAre17ScZda5d+ly5ijM24q 8b3MEQWI7WJH4K0xZ8HbxfpRpgP+sBq2+bZgL45q7MLqhga9zZLnhlhpM35g1EO4fSsP6E30qoB 65eOVGBhRW4amXaAGEXBysCYZKSbf5XiriDtMEeQxRV1K6IYHTYY2c0i2BboaE1UL7GANETp0Mk SOoyuOqsdgxJ9RiMgp30KS8aqqYYvtBY+V2bJXiR4RzHsmSYpdQfZ7w2VUjLlfUxPvzWReN90jA IpzZ5CJ/w0/j5a7ZGdPuWWzqB7UgeZRWjORuGiiNStFPYgubsRMHSHpDZvRLIlVA9mIm2q9ro7/ x47luj00YBYYFIcJK7tZGGCirleSIV/cMccJLLPnCfhfvvwNe7Qgvzw7qn1FRs5tT/N1OeJDXAE hnudTMVU9IgsN5miKez+nz9r0Tk8yxTlEzdFkTAnNeW5l66yAbq1tOovFqhO0A5VgVkm3unrjVn SfIqA2tjKCNuhFQ== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH hci-8.1 7/7] drivers/md/dm-qcow2: process fast path qios in per-cpu batches on a workqueue 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 I won't apply this version, please send v2 with the changes below. On Thu, 29 Oct 2026 17:03:46 +0300, Andrey Zhadchenko wrote: > context switch) even if a running worker would pick the work up right > away. PENDING is cleared when execution starts, so a qio re-queued > while its work runs wakes yet another worker just to find the collision > and go back to sleep. On a 12 cpu box with 4 submitters this shows up > as ~3 context switches per I/O, 5% of all cycles spinning on > pool->lock and 6% in the scheduler. Items 4 and 5 of the cover letter reply: - fix the re-queue sentence; - move the measurements into this thread; - add a paragraph that the fast path is now serial per submitting CPU, and why that is acceptable. Why: after patch 4 every qio work is queued exactly once, so no qio is re-queued while it runs. The work that is re-queued while running is qcow2->worker, and this patch does not touch it. On your answer to Sashiko: O_DIRECT is enforced for every delta, that holds. "We only submit IO" does not hold for all fast-path qios: a partial discard runs qcow2_punch_hole() right in this worker, which takes the inode lock and waits for all direct I/O in flight on the image. Everything queued on that CPU waits behind it. Either send partial discards to the slow path or say it in the message. > + for (;;) { > + node = llist_del_all(&fc->qios); > + if (!node) { Item 4 of the cover letter reply: bound the loop, or add cond_resched() between batches. Why: while one CPU keeps refilling its llist this work item never returns. flush_workqueue() in qcow2_flush_deferred_activity(), which the backward merge completion calls with I/O still running, waits for it. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel