From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: alexander.ivanov@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v2 4/6] drivers/md/push_backup: fix mod_timer() usage
Date: Tue, 3 Nov 2026 03:32:44 +0300 [thread overview]
Message-ID: <20261103003246.712239-5-andrey.zhadchenko@virtuozzo.com> (raw)
In-Reply-To: <20261103003246.712239-1-andrey.zhadchenko@virtuozzo.com>
mod_timer() takes an absolute jiffies value, but both callers pass a
relative one. After about 5 min uptime this causes the timer to fire
and re-arm on every tick. This has not exploded because we still have
checked pb->deadline_jiffies each time.
https://virtuozzo.atlassian.net/browse/VSTOR-152912
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
---
v2: no changes
drivers/md/dm-push-backup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c
index 8ce84a1a696e5..b1861204f6e3e 100644
--- a/drivers/md/dm-push-backup.c
+++ b/drivers/md/dm-push-backup.c
@@ -244,7 +244,7 @@ static void pb_timer_func(struct timer_list *timer)
spin_unlock_irqrestore(&pb->lock, flags);
if (unlikely(time_before64(now, deadline)))
- mod_timer(timer, deadline - now + 1);
+ mod_timer(timer, jiffies + (deadline - now) + 1);
else
queue_work(pb->wq, &pb->worker);
}
@@ -278,7 +278,7 @@ static int postpone_if_required_for_backup(struct push_backup *pb,
spin_unlock_irqrestore(&pb->lock, flags);
if (queue_timer)
- mod_timer(&pb->deadline_timer, pb->timeout_in_jiffies + 1);
+ mod_timer(&pb->deadline_timer, jiffies + pb->timeout_in_jiffies + 1);
rcu_read_unlock();
if (queue_timer)
--
2.43.5
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-03 0:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 0:32 [Devel] [PATCH hci-8.1 v2 0/6] dm/push_backup: event fd interface and fixes Andrey Zhadchenko
2026-11-03 0:32 ` [Devel] [PATCH hci-8.1 v2 1/6] drivers/md/push_backup: correct initialization Andrey Zhadchenko
2026-11-03 0:40 ` no-reply
2026-11-03 0:32 ` [Devel] [PATCH hci-8.1 v2 2/6] drivers/md/push_backup: clear pb->alive under pb->lock Andrey Zhadchenko
2026-11-03 0:39 ` no-reply
2026-11-03 0:32 ` [Devel] [PATCH hci-8.1 v2 3/6] drivers/md/push_backup: do not re-arm deadline timer in push_backup_write() Andrey Zhadchenko
2026-11-03 0:41 ` no-reply
2026-11-03 0:32 ` Andrey Zhadchenko [this message]
2026-11-03 0:41 ` [Devel] [PATCH hci-8.1 v2 4/6] drivers/md/push_backup: fix mod_timer() usage no-reply
2026-11-03 0:32 ` [Devel] [PATCH hci-8.1 v2 5/6] drivers/md/push_backup: arm deadline timer under pb->lock Andrey Zhadchenko
2026-11-03 0:45 ` no-reply
2026-11-03 0:32 ` [Devel] [PATCH hci-8.1 v2 6/6] dm/push_backup: add event file descriptor interface Andrey Zhadchenko
2026-11-03 0:46 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261103003246.712239-5-andrey.zhadchenko@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=devel@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox