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 B32BF80E7E for ; Tue, 3 Nov 2026 08:37:53 +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 6A38aZ0K002546; Tue, 3 Nov 2026 11:36:35 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A38aZ0K002546 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793694997; bh=7BFPhSxfMJ7QilqxRD2haB5Su8sPhAOt5JG0jIqIlqA=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=tOkgAokIs1kbfBuzt2FE+ZiOGtozXDHkor941bopRiETzu/ivq4OX+XU9z+dKi88T ZHV10twS8fWjY2VJskeaZudRqGeigRZIv3ShN32alwgffn14u+adAQT5GIctZR41Ba ZPbXTkPxkEr0AQe1GaPGC9YidTLP7PQBVbOn7UuxqXbIV46bhJJcyQBXLKaFzsQn7z A4pg/X4Qm6j2WxNkQsAxhJ1uefAtQvlW5iHEdrOWRZY/dzasZcroFDHwaZcNPx3vLZ 1nbXln+QllH0yurNheXisrZ1K6IUbHDE0abHGLQSYjl6mig8Bhz3ZFCyVmFQfqd9at wRGOfJSQHqREQ== Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A38aYa4002542 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 3 Nov 2026 11:36:34 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A38aYa4002542 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="tDzZwuvI" Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-48dfaaea30cso2690233f8f.0 for ; Tue, 03 Nov 2026 00:36:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvByUqVp5GFI6njLdtWFJ5qGwFqKRIzPIqMQsgudyiAuiHtZXt+yXrDOaPqw3baU+op6cgqidOA==@openvz.org X-Gm-Message-State: APuU4Z+IRB5eIBZeoJkWZ861LLHVWIbUgDGio5/SY+IXSWrS5kTDKne5 0oRxy5+CLd8xz4BV8CCPRyJCEctCkQMohgRMWf1Q9lrmqGW8MWTPEqjdZaOCovCCB8qSAImEqh0 t+q+NSZC+nqWQwMT/u4hWdB0EtEK39r5nV0FFYYC15DP/IvAnEgmq9A== X-Gm-Gg: AYBFou2Ipf8P+K201HgN5EVPYlHfCE0AKjcmLS5piz6CQqcJ2vC5Yn/BoLqhgSeHTN+ 5cbbZx2KdcnJFCMzXcwQptDg0YhKtDuS/Kzqn9V8TcUsIbtA3JxAtd2EyiSiim0OqRYzHSJ+/7k /+UkL4E3w9CHabjN+4a2SpA8AQImIs2iYKRrVBfDs1zpTUGy2JQ6WOc8kmjukndv/K8P5AWSEMC /IERKQLwfCjCl19ngR6L2eckxHUcrPB0ldn32P0Joe5azxno35rpk2R9kpDa7KPDWSmX6CYKaqW 0ubzUKURMw== X-Received: by 2002:a05:600c:698d:b0:4a2:994:575c with SMTP id 5b1f17b1804b1-4ac185bcc4emr284799735e9.34.1793694994214; Tue, 03 Nov 2026 00:36:34 -0800 (PST) X-Received: by 2002:a05:600c:698d:b0:4a2:994:575c with SMTP id 5b1f17b1804b1-4ac185bcc4emr284799335e9.34.1793694993819; Tue, 03 Nov 2026 00:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793694993; cv=none; d=google.com; s=arc-20260327; b=rTCmfZHYzyjA+9PtlFblJpB1qs+u3tOD5CKbQ7n4uh0H04ZH75sCngym2opzTMICQH 3RoV9cyx9McIFDVRHQu6NGB7jTPdS+g4baErwMPtMeIPy/P4Q7GZ0nbWeOpLT96ejtUS qCkeQm39O4BptTkmglgxfbIjlhvjfX68dUFz0U1pIhcH7mnVKhNapRhCwzna/khoGLsd CROkKMY4yfQwVs9WzCsM3vzZt19s1PCJPZ8RAxNf7nppT0yINkxrRbsHCBsrrN0hRNJ8 57/wxDaHuqzBM4ZSGc1HaOKGOWWaJV0tFVE6zstMPT0p54gYuN7PmJG6cWfsqTjqnCLB X8cQ== 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=NQjRFV+Dk4a7wqOmHcIH6dPkPVRy4jhYDuA54uOeWeA=; fh=RfLy8WadtWA7o8Nwyw1/qXZXVl8V7nyVpkffDmriPJo=; b=e7JpHilchh54H7itTTHvRfkXgjfvczY73l3QP+6VomuOL6nwpltFSmnmuuNc+gHeMn kEeB6nYjhAZkvldDJj9oykLZGwsbIen30c+l4zQW9K+Yt8gOsDhqcf/HIXnkI3YNBXQG wjdVaNwBNcalwqqEXMoQL++Iwadd/Zxn/O2eMUgz7yppB03gyATZ09M6wuAa0k5LWQAR uMsQR684Ot1q69UR67H/qNFs3/o2OFvs3RlYA7Yas0MpVkTqMoWjIwv09bq5jOQko2lS 1OvIIQyoEapcBUWR3922L6afwNJG/Va29ROFDeRhtQtUXzGlmAFgSEHUKeWYLKaCmkpf UhXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=tDzZwuvI; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:c789:8bc5:fa8e:d502 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4ac203dc6c9sor23239575e9.16.2026.11.03.00.36.33 for (Google Transport Security); Tue, 03 Nov 2026 00:36:33 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:c789:8bc5:fa8e:d502 as permitted sender) client-ip=2a06:5b06:b600:300:c789:8bc5:fa8e:d502; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=tDzZwuvI; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:c789:8bc5:fa8e:d502 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1793694993; x=1794299793; darn=openvz.org; 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=NQjRFV+Dk4a7wqOmHcIH6dPkPVRy4jhYDuA54uOeWeA=; b=tDzZwuvIJqltRV93aF39ucfYBQ8+6xmqCQAeNRjez1EvRqE7eSwVv3GI34FWkUHhvV 7Q6wT48kiGOvWuCV+JOuQpw7wyyo244NCMvqiHHKCTq5cOFbqcTzzj5sgHcPkN94v3LM /d2kC6zByN9NNAJLNUmuPl7mdI0l1Lylq8xPzdkh1RyRrp+SeGAE3rihVCIw/GmPhCgU TIJmHpFRf++EY81idzMjLexe133Dd/uN+lzwbuH9Mql3/BK7ILWEc51Qitq7du6EMx83 YkQ9krjmFTyPFmn+9qHzgzK8QPa2oifwOd8cZEP904cFKdSecos5Ssan+CRB9PuVr/iF UrOw== X-Forwarded-Encrypted: i=1; AKwUvBzXd5u1Ph1zef9jCYGUVvv07uKmXTpO9xyYyLg5u20AYcXUpOn4OimnCHKt+oSfBUTJACOk7Q==@openvz.org X-Received: by 2002:a05:600c:310e:b0:4a2:10f9:37ce with SMTP id 5b1f17b1804b1-4ac1709ae70mr279727175e9.15.1793694993264; Tue, 03 Nov 2026 00:36:33 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:c789:8bc5:fa8e:d502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b2aaa4b91esm38000195e9.11.2026.11.03.00.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 00:36:32 -0800 (PST) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Tue, 3 Nov 2026 09:36:22 +0100 Message-ID: <20261103083630.130596-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 0/4] dm-ploop: fix the pio submission stop around cmds 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 A cmd stops pio submission and waits for the inflight pios before it rewrites the BAT levels or deltas[], and expects nothing to touch them until it resumes. Konstantin found three ways this does not hold while reviewing the VSTOR-151979 series (VSTOR-152985, VSTOR-152984, VSTOR-152981): - a submitter racing the stop either runs without the cmd waiting for it, or is parked after resume and never completes (patch 1); - the ploop_allocator() thread is not stopped at all. It truncates the top delta while merge or flip moves it in deltas[], cutting the live image to the preallocation size (patch 3). The thread can also miss a wakeup, which stalls the device by itself and would hang the new wait, so patch 2 fixes that first; - a grow failing to copy a cluster resumes submission with that cluster's BAT page still busy, and writes to it hang (patch 4). Patch 3 is the one losing data: a snapshot delete under write load is enough. Tested on dev-cl04, stock 6.12.0-211.52.1.22.11.vz10, dm-ploop built out of tree: - each bug reproduced on the stock module, the races with a test-only kprobe module widening the window: a pio running past the suspend of a cmd; a pio never completing after resume; the top image truncated from 512M to 128M by a merge and to 256M by a flip; after a grow failing with ENOSPC on a full host fs, a writer stuck in D state, an unsuspendable device and a later cmd failing with ETIMEDOUT. None of them reproduce with the series; - fio 4k random reads and writes, O_DIRECT, 1 to 48 jobs, on a fully allocated image over brd: IOPS and system CPU stay within the run-to-run spread of the stock module. This setup tops out at about 420K IOPS elsewhere in dm-ploop and would not show a lock taken on submission either, so patch 1 keeps that path lockless; - the ploop pytest suite, ploop and qcow2 formats, passes. A test for patch 4 goes to the ploop tests separately. Denis V. Lunev (4): dm-ploop: fix pio submission racing with the suspend and resume of a cmd dm-ploop: fix a lost wakeup of the ploop_allocator() thread dm-ploop: wait for the ploop_allocator() thread before changing deltas[] dm-ploop: fix a failed cluster copy on grow leaving the BAT page busy drivers/md/dm-ploop-cmd.c | 18 ++++++++++++++++-- drivers/md/dm-ploop-map.c | 22 +++++++++++++++------- drivers/md/dm-ploop-target.c | 4 ++++ drivers/md/dm-ploop.h | 1 + 4 files changed, 36 insertions(+), 9 deletions(-) base-commit: 09eb9a82fe872048d082391415d1cdeda2ac6879 -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel