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 470E080F25 for ; Thu, 29 Oct 2026 14:09:50 +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 69TE8Y4r001003; Thu, 29 Oct 2026 17:08:35 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69TE8Y4r001003 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="uED5GmnC" Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69TE8F1n000947 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 29 Oct 2026 17:08:15 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69TE8F1n000947 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48dff112181so1900518f8f.3 for ; Thu, 29 Oct 2026 07:08:15 -0700 (PDT) X-Gm-Message-State: AFq9FYIha5wXazm/kVoz06SPdGt4oOxxiqNCabw8oz3hiw7qK8vjDyyk XBs4AXZKbZgGr61K9yqYhcQ98KGkDDKOFSbxtA+5fKHQirtXGii3OcJmL+crS+uViua3W2b4O/3 DjuoPyiClWSa+43MgtFpeFM5+rH/agz8PCslqaqES0TzkDoLvclNDuQ== X-Gm-Gg: AYBFou3WxM1K7yyHG5lE369FTwOY2/+WT11z1lYTQBz9oJmrQxSb69jYUTwA2AfAcjg mmvVDYprRPyuF2ASKLcfRxzC7Qfd1Am24n8/nL/fAj/37Wdds+KjtDf/tll85M4EXUtUr8/CjtZ sHkZ3TefQKq8HlbnlyDl74rE+pqBuEJcePXcwMK2tcJnd+ZLJlroDfTXQ3U639MI/+0DchGwWAl qyoO7BAiPz00iCODNtLeyX9hMDaHvd79wbrQ9DUZZ+jXv6pSbHNTsbWRqWDEfGtsSB0ymiq0rcr hNlY2YR3rVAvY+2yALjUSAIwthJdx79x20iWO9Kzdc3EYLL7OY/gdEmN31NyGZr1P1lFpXYMdUm t7UpuEGqgXLhmA3RuwzDY4mWf7eRmWA== X-Received: by 2002:a05:6000:4715:b0:48e:48be:2796 with SMTP id ffacd0b85a97d-48e5d5a82b6mr13760006f8f.39.1793282894971; Thu, 29 Oct 2026 07:08:14 -0700 (PDT) X-Received: by 2002:a05:6000:4715:b0:48e:48be:2796 with SMTP id ffacd0b85a97d-48e5d5a82b6mr13759866f8f.39.1793282894259; Thu, 29 Oct 2026 07:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793282894; cv=none; d=google.com; s=arc-20260327; b=Q0nSRouMK0E320Br8C2mpYPSgf1xsU0bFIT67M15HXw373rRJP/hRWAHRMv+zDsbtH cPsSgXpp0zT9aedbgWuSDUpGc4Q3CTHQj9dpH1NxPTPNA/IsHZt6Xhe5PzvZDdoOe4A8 LyVX6Bxxn0nHi0uuO+kPTtEa2GKZtqycit5f3P5QeVVR6CYKX7P621q53IrAlJ9i+4uU 6/FRNYr7xBB4Omn9GHmM+IxEKlG8wzBxFSro4fl2h4xCSoECJSa3CjhGZ3x1lCN8XCK2 fmRx5/yDRWU5RUG61idhcHRzL+VH75OXQq8JxZ647/YkvweHfDvi4wGv4EGl3SBFr5La gHYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DbsCZvMHYT3zAhDw7Er1OAU2avk0MgpctmzrwprvSVw=; fh=3k0+fZVGiCNBaT40qYgWCtd7msMp1ssBZtvctQUZc8k=; b=KsBIo39i/CapyLCIVqAy9pjnMlvFwk1fzakDjNIUJL4SdCmLa3VYhnyEBWVYC8ahq4 Jiat0+kfm8k/UKCaM0wT8YUwJIVnvhabXI1XiLx+49e3TwWpb9fPYxvxGAoGf5+Cf3K/ BHVeS8TBjN//1hIi/YEvHRRCoBmIO0H+zi5hdMSr/0nQQCCxVjYu1TvgL9kB3p/EKbpA z/dHatZQ0HAIMsdUw0yG2iHb+lsi5UORO1v618d/AgbWCfwyXmbQKMB5DkAEcPlCqgrQ ViGfH5ua3EecWKVgity2wV2Ap/+MJBxFzo2eR1dO1U9YyTUthPuZgZ406/2e1v45plL3 PgcQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=uED5GmnC; 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-48e3eb9cfcesi42538037f8f.2.2026.10.29.07.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 07:08:14 -0700 (PDT) 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=uED5GmnC; 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=DbsCZvMHYT3zAhDw7Er1OAU2avk0MgpctmzrwprvSVw=; b=uED5GmnCd5SG /NH1mNn/J5v/L+Pb8B7Kr+tuFVcAf8QKtk/Gg0IR6capRTbXzfogB56Z3Miu35WG074MdRzcfVD+v BAFSoDFa/cA+of++hP9ueEs09VubAUJ3CgAypCTygCbQHoEo/CzqdRQ4y1Y6Xz9DvvrarSV603ax6 ZqrjMnFKXWMBEIb/bbGUpkYaQNPZnsLbX8rR2A9kYeL3dmGXXCgce8a4rPHhbXWp70gTADDIt7WKZ 9w2r0ePEJQRKtxFU/LyA8vPGdrUXQd4iswhlTsiTPIOEZYNpID3lk5Jfz6ihGTc+zrD3NhpTUFlvV j0Vh6X6ePJ46R9O2HD8M5w==; 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 1xMQjp-006pKz-2w; Thu, 29 Oct 2026 15:08:11 +0100 From: Andrey Zhadchenko To: ptikhomirov@virtuozzo.com, alexander.ivanov@virtuozzo.com Date: Thu, 29 Oct 2026 17:03:41 +0300 Message-ID: <20261029140346.465768-3-andrey.zhadchenko@virtuozzo.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20261029140346.465768-1-andrey.zhadchenko@virtuozzo.com> References: <20261029140346.465768-1-andrey.zhadchenko@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 2/7] drivers/md/dm-qcow2: check MD_DIRTY and md->wbd under lock in perform_rw_mapped() 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 Access to md fields was relying on dm-qcow2 sequential nature. Expand md_pages_lock to also cover it so it can run in parallel. https://virtuozzo.atlassian.net/browse/VSTOR-95494 Feature: dm-qcow2: block device over QCOW2 files driver Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-qcow2-map.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c index fed6ce75e98ad..1023224484f5b 100644 --- a/drivers/md/dm-qcow2-map.c +++ b/drivers/md/dm-qcow2-map.c @@ -2908,14 +2908,18 @@ static void perform_rw_mapped(struct qcow2_map *map, struct qio *qio) * wait for md writeback completion. * * L1/L2 pages become set and unset dirty from main work only, - * so lock is not needed for MD_DIRTY/changed_indexes visibility. + * but this may be called from per-qio fast path in parallel + * with main work submitting the writeback and with its completion + * dropping md->wbd. */ index_in_page = map->l2.index_in_page + !!(qcow2->ext_l2); - if (rw == WRITE && (md->status & MD_DIRTY) && - test_bit(index_in_page, md->wbd->changed_indexes)) { + if (rw == WRITE) { spin_lock_irqsave(&qcow2->md_pages_lock, flags); - md->wbd->nr_submitted++; - qio->data = md->wbd; + if ((md->status & MD_DIRTY) && + test_bit(index_in_page, md->wbd->changed_indexes)) { + md->wbd->nr_submitted++; + qio->data = md->wbd; + } spin_unlock_irqrestore(&qcow2->md_pages_lock, flags); } -- 2.43.5 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel