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 D75218017D for ; Tue, 3 Nov 2026 00:38: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 6A30b70q030702; Tue, 3 Nov 2026 03:37:08 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A30b70q030702 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="Z+zvx+As" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A30b7av030674 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 3 Nov 2026 03:37:07 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A30b7av030674 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4ad3d35e899so19025585e9.1 for ; Mon, 02 Nov 2026 16:37:07 -0800 (PST) X-Gm-Message-State: AFq9FYIcGDUMzJ4UlCuRZkqwGV59KHLlcLvm7dMpZ5sVX/IsHljwkFy5 XxKjZ3Pz7i9QiPFYIKsZa0w/DadiKXH4wJ+1Uq40iGj7TEcRyUC1u+RBGXv54y659e6fCENw1Ac 7g9pZPg11tWo9r6SQg8Trh/6IeGCq0J3Fpvc0VthYikMs6PrD7qanBQ== X-Gm-Gg: AYBFou3E2bxW0sxSJYoBQlDLfdIlxxRMU6IyecSLFi1GZSbQbqQZmHZbZ54iIKBU5F1 QeBTA3gpY1UUOLK+ZYrvgmN0JLphP0epPXTf8u7+2ydPf0Iyo8tzMOtkQm58wrfIclAclw3hCns Cu8H0f6eQds1874dPwqSeuasOKbLK2Av/M0H6hfLyRXYnQ+Q4KZTf8cyf6heZt3DigowstqyAdc ewAHbHrue8j+BmPXSwVv/OaF3xd4x0czC5kD9AhNkDZPhs2jYuZfJxSyIUctwU6wCUqpO6X2PuK UzCQwHzGKfcLBjXFa0TwWnrVdi26Ck1Kph0DTrvPx7+lEjP5iJHSb99+8HhZDp1/bescbi7fksX dctMzUI7Gm+hSItD2tO5Zu33rX7EZXg== X-Received: by 2002:a05:600c:4e02:b0:4a3:59c9:a758 with SMTP id 5b1f17b1804b1-4ac19705e02mr250906235e9.32.1793666227021; Mon, 02 Nov 2026 16:37:07 -0800 (PST) X-Received: by 2002:a05:600c:4e02:b0:4a3:59c9:a758 with SMTP id 5b1f17b1804b1-4ac19705e02mr250906005e9.32.1793666226553; Mon, 02 Nov 2026 16:37:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793666226; cv=none; d=google.com; s=arc-20260327; b=lzsRpjdyZUWpLXX3KxvW96gPnpCMoViIPRyDJ0E/NqrhNhV+mT3NPKirx0dCiZRP6E OI/any+JYNiXK8q6rNRzlMeSGqY50KHaVhQhEYSLxH2MYWelF82vxJ5ii3whgPX5Wope 0gM6fZJbmn1QQUqbtudFizY02+TO0TI08qSU98E/bbcM+OHPut589BHlmgceMejzRHYG vhm16abNyGf2FAaAuXQFsqpGe7Kr60Jyh2JYb7/0PawWK/5JEUAiCz5Csp+utyZWC6+3 upSiUMNJ+rn+D4sqwxgWGtb2QF8+Jgyl1NowiZ7JfRUWcuJqtFWbw9zveIor/sajDEOV uouw== 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=sUzjCfUHxBvw42qSKwk+hT+G6Wzq0QrlF4/RtnwNsps=; fh=9VH7xbtOhOOwoVYPb8YgTvr+erGWPni2iwCEEh8Zz6s=; b=EILRukmKlGtgS26Hynm8W5hFWI4v+eA3OPm8lW+ufLtxtpRpt+iHpEmyWICNbe4G/6 rZe3pqsL1GRZaCVXEseMKWathSvaMhAnqlkb4qa7jp0gSVFnvH5P04DexMZtVbltTBHB VVNx3+N7UNtocSVUKCWHUJyajeXc7x/30MVnxc33FYrBrwjC5vxOJwR4CC6d8YA+4Br1 lVD9gmMYAqMr+FyoktFZZ7T92hzsqjpk6NsM1l/Fpq80KQIYd+qof0Ip2NldnMIqkzhB fBdAWLh/PTvzc49JHypjBujonsd9CapJSpfssiM2SOQiGeSD8wrXQW5okTy3S7S0lQ2O Nl+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Z+zvx+As; 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-48e71bb75afsi24918369f8f.222.2026.11.02.16.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2026 16:37:06 -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=Z+zvx+As; 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=sUzjCfUHxBvw42qSKwk+hT+G6Wzq0QrlF4/RtnwNsps=; b=Z+zvx+AsD1Jb 5AQAaxc872ScpFME5GwjuA1MCgaS5Q1YTsdUa+kClq/bRkkv2Z+RtfJEVx1XIXMEI9tIfNx8RpX+w LsaCIlXZjqE2M2UCiAIUZ6jM1XnC4l5cQBP9ztFSAypKEMloT3nZozfvDPtaaod6ItdeYDJ+418rb rucCAXnYQbxxXZNzjhumMgYxlliCIWANZNFTIn4evGrOIQstW2I/37u2iiq95fi3qJYjaX1y634yN D0vHCIOTuG5BaOrTsBHJ3zPwA4sZsnx0lbbH68/IdiJMidPAPx7hJd613F33K37qVLqSJF4Be5KxM zHzf7Nk8jSHq/BUJFt7FnA==; 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 1xO2SV-00D56q-14; Tue, 03 Nov 2026 01:36:56 +0100 From: Andrey Zhadchenko To: alexander.ivanov@virtuozzo.com Date: Tue, 3 Nov 2026 03:32:40 +0300 Message-ID: <20261103003246.712239-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 v2 0/6] dm/push_backup: event fd interface and fixes 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 The push_backup target currently makes the backup tool wait for the next cluster range inside the "push_backup_read" target message. dm runs target_message() under dm_get_live_table(), i.e. with md->io_barrier SRCU read-locked, so while the tool sleeps there anything that needs synchronize_srcu(&md->io_barrier) on that device is stuck: suspend, table reload/remove and dm_internal_suspend_fast() from "@stats_create". An unrelated dm-stats user hangs, and everything that later queues behind md->suspend_lock hangs with it. Patch 6 adds a file descriptor based interface instead. The tool gets an anon inode fd via the "push_backup_get_fd" message and then uses plain read()/write() of struct push_backup_range to fetch the next range and to acknowledge it, without going through dm messages on the data path. The fd pins struct push_backup with a kref so it survives target removal and simply returns -ENODEV afterwards. The legacy messages are kept for compatibility. Patches 1-5 are fixes found while working on this: 1. init the lock, waitqueue and timer before anything that can fail so pb_destroy() is safe from any error path; 2. clear pb->alive under pb->lock like the other users do; 3. drop the redundant mod_timer() in push_backup_write(). The timer re-arms itself from pb->deadline_jiffies, so updating the deadline under the lock is enough. This was also the only place that armed the timer outside the window push_backup_stop() waits for, which matters once writes may arrive via the fd without pb->ctl_rwsem; 4. pass absolute expiry to mod_timer(). Both remaining callers passed a relative value, so after ~5 min of uptime the timer fired and re-armed on every tick while a write was delayed; 5. arm the timer under pb->lock. pb_timer_func() and postpone_if_required_for_backup() both decided under the lock and armed after dropping it, so a stale S64_MAX could overwrite a fresh deadline and park the timer ~12 days out with delayed writes still pending. With arming done under the lock the RCU dance between postpone and stop is no longer needed and is removed. v2: - 2/6: reworded the commit message, dropped the KCSAN claim. - 5/6: new patch: arm the deadline timer under pb->lock and drop the rcu_read_lock()/synchronize_rcu() between postpone_if_required_for_backup() and push_backup_stop(). - 6/6: resubmit_pbios() now frees the pbio before dm_requeue_original_rq(). The requeue drops the md reference held by the in-flight request, after which __dm_destroy() may run .dtr and destroy pbio_pool under the fd writer's feet. https://virtuozzo.atlassian.net/browse/VSTOR-152912 Andrey Zhadchenko (6): drivers/md/push_backup: correct initialization drivers/md/push_backup: clear pb->alive under pb->lock drivers/md/push_backup: do not re-arm deadline timer in push_backup_write() drivers/md/push_backup: fix mod_timer() usage drivers/md/push_backup: arm deadline timer under pb->lock dm/push_backup: add event file descriptor interface drivers/md/dm-push-backup.c | 252 +++++++++++++++++++++------- include/uapi/linux/dm-push-backup.h | 36 ++++ 2 files changed, 229 insertions(+), 59 deletions(-) create mode 100644 include/uapi/linux/dm-push-backup.h -- 2.43.5 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel