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 B2A538045D for ; Wed, 4 Nov 2026 08:44:07 +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 6A48gsS9022389; Wed, 4 Nov 2026 11:42:54 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A48gsS9022389 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="rB7oFN1s" 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 6A48gbbj022346 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 4 Nov 2026 11:42:37 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A48gbbj022346 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-48e00f3929bso946062f8f.0 for ; Wed, 04 Nov 2026 00:42:37 -0800 (PST) X-Gm-Message-State: APuU4Z9cf5MrlfiV7ab9MfJPTCPHAqv8yJ3wkkVxeL0p1tCohiJ62g3s vVeAm1Sjj/Tka3NVV521cKkgwScz3aKW5yp2btqKkF904udPo8NIkPH0U7/mViduMV9o42jS9n1 jtjfOf/lpO85fI+vycCoRVLS+CB0iYsoxcOVLiMTEIu+7MCY7uD7q0A== X-Gm-Gg: AYBFou23ps6wcs9Ikv5G1BDhBKwNJAqCO88r7u81YGfzjqek4KwubE4GxVsENe4+xkw thYR5Otxt4kF1QMkmiuJYE79D7b320q60jhoYvCAkxqZ07V2O8u09ikh1zFn2YxlrMP7pDhehoJ qkZwfcQSA0rq8Zu22qiLQi0EpR1eE2U2n5f6R7ffpho3iTeJs4XGBGz4Ya874CXJDBuP3K9aUZ1 K7D1X21HXvq1+VYyVFfZHVdtkZP4Hfj5x58GDYYoNU/tT+7OZttO/Q/XQs0BuflmhVlN9+IX+De b2gxcqu+YiHelPiBI4LD/az8ji7BYcbNoBMSBM0gxD8CYXneCjW3RjB0oYFkhXkKmZaJwM99IUS EWN9y1DrGwJ6g0gWQWTqnNdj3V8TdKA== X-Received: by 2002:a05:6000:40db:b0:48e:5d06:8b66 with SMTP id ffacd0b85a97d-48e6e2dbbc5mr37992102f8f.19.1793781757260; Wed, 04 Nov 2026 00:42:37 -0800 (PST) X-Received: by 2002:a05:6000:40db:b0:48e:5d06:8b66 with SMTP id ffacd0b85a97d-48e6e2dbbc5mr37992068f8f.19.1793781756742; Wed, 04 Nov 2026 00:42:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793781756; cv=none; d=google.com; s=arc-20260327; b=nUb2ZH2qLGpDU8mIUqO8kW5RfqKliKdET9ekDtNNH5oBoqMFxhOcsPtDirrlAW85zx vNq3SvaZO+I7uUd1j6pTeGbaKbbpcD1xcxoRoDT1Fr+v/8h3RgvVKNBI8KCFfQxek4tm bo/+XYgdYjdrQ6q0KLxf6cv1oBhAzz+F/pIhd7V+uX21znr7PJu/nZ2M2zLSWuXnw2BJ 5bE279VNlL29LIhUmF57ORo28+wLMozG1RLYudmf0tEigrAIApFDe8ZUjQ5JglvRRxMA tiJ8qWQBu9KNligdaHvpVamVPoIehv0877c/TjOSo7HSgARy5SahJ6Med+ud3R37sTFZ ZLKA== 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=EWPDb8hbNj4xJbaNwqfSgqQFtI0jesI2FS3zh2YMT3Q=; fh=ElTTnnNtphHTCCOZ+58STyaWac7y7ytLDJZIF4HMMJ4=; b=oJJ+aozOWbKr9ai4yNIdO+Z4YeJ/p/CRjY/7XPX2Qq3JiX+7r2pQOeDJ8uA9tNjwN/ jXRY8CpLwVb9xR5R18oQRD6IZHW+TnK3w/oixA4YWtQn5kzlfqMc1EXw6CEYk/NPe2al tcF+bWFtnlesAkaQ2XIG77mmXCVzqu8CHSO4B4PVurSNcyvaJv8EdSR8tuS+mKOzcF24 d0KrLouQnzVUU3quxEeNWImfE2NpvOsGpg+qwJIQ7emeaYCSTBqIL5lBps/A9nfoYGtE wMKg9NO0fudQhjVB/I1zHDhmu2bpk0WldpS65vHhEb/HC04PsgpEAga4vQLncqScbycf Ln4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=rB7oFN1s; 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-48fef208a54si2787638f8f.302.2026.11.04.00.42.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 00:42:36 -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=rB7oFN1s; 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=EWPDb8hbNj4xJbaNwqfSgqQFtI0jesI2FS3zh2YMT3Q=; b=rB7oFN1stPF1 YwpNL3ICTEjDIZeDTO37Dh/7Ehjd3rNfAQwZYH3y/uYteZLAH3s6UMcoxanElQ9xQTW1Ac73KI7dP +Airb42LsWabOgcL5QuTW0/KZ/F+acH3+ayYuipgQahXwad6v2q+JBXwkunaARAm11NS6KXaatVm4 6O47VcsoLBEYUVu4isSfIMUMLXS4Ec98MY9oeiw5PsIrR1rza6WNBMW8za6vP1frgHAsoeO0Qpr1c VOO6NSFX8BsgDONnz53/6Y0F18oqBKjnqa4NLTQ+xU0u+xGs46V7d9QUxOTgWUahXGJSlJBOSuWvR 2UgS4GyKrG+iUwGuNX/riA==; 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 1xOWVr-005ttV-3D; Wed, 04 Nov 2026 09:42:36 +0100 From: Andrey Zhadchenko To: khorenko@virtuozzo.com, alexander.ivanov@virtuozzo.com Date: Wed, 4 Nov 2026 11:38:17 +0300 Message-ID: <20261104083818.856720-7-andrey.zhadchenko@virtuozzo.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20261104083818.856720-1-andrey.zhadchenko@virtuozzo.com> References: <20261104083818.856720-1-andrey.zhadchenko@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v6 6/7] dm/push_backup: do not re-arm deadline timer in push_backup_write() 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 pb_timer_func() checks pb->deadline_jiffies every time it fires and re-arms itself under pb->lock while requests are delayed, and postpone_if_required_for_backup() arms it under pb->lock when the first request is delayed. So the timer is always pending while writes are delayed and we don't need to re-arm it after updating the field. This call is also not done under pb->lock. Today it is harmless because write and stop are serialized by pb->ctl_rwsem, but it would re-arm the timer behind timer_delete_sync() in push_backup_stop() once the write path is reachable without the rwsem (next patch). https://virtuozzo.atlassian.net/browse/VSTOR-152912 Feature: dm-backup: push backup target driver Signed-off-by: Andrey Zhadchenko Reviewed-by: Alexander Ivanov --- v2: no changes v3: no changes v4: commit message typo v5: moved after "arm deadline timer under pb->lock", so no bisect point re-opens the race; dropped the "only place" claim v6: subject prefix changed to dm/push_backup, added Feature: tag drivers/md/dm-push-backup.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c index f0de26add11c2..52ba80b703ff1 100644 --- a/drivers/md/dm-push-backup.c +++ b/drivers/md/dm-push-backup.c @@ -463,8 +463,8 @@ static int push_backup_write(struct push_backup *pb, unsigned int clu, unsigned int nr) { u64 i, key, nr_clus = pb->nr_clus; - bool finished, has_more = false; LIST_HEAD(pbio_list); + bool finished; struct pb_bio *pbio; if (!pb) @@ -515,8 +515,7 @@ static int push_backup_write(struct push_backup *pb, } } - has_more = (pb->nr_delayed != 0); - if (has_more) + if (pb->nr_delayed) pb->deadline_jiffies = get_jiffies_64() + pb->timeout_in_jiffies; else pb->deadline_jiffies = S64_MAX; @@ -525,11 +524,8 @@ static int push_backup_write(struct push_backup *pb, if (finished) wake_up_interruptible(&pb->waitq); - if (!list_empty(&pbio_list)) { + if (!list_empty(&pbio_list)) resubmit_pbios(pb, &pbio_list); - if (has_more) - mod_timer(&pb->deadline_timer, jiffies + pb->timeout_in_jiffies + 1); - } return 0; } -- 2.43.5 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel