OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v3 3/6] drivers/md/push_backup: do not re-arm deadline timer in push_backup_write()
Date: Tue, 3 Nov 2026 07:49:33 +0100	[thread overview]
Message-ID: <c4bdc67f-4931-4f8b-a29b-46d0e296afac@virtuozzo.com> (raw)
In-Reply-To: <20261103061752.720813-4-andrey.zhadchenko@virtuozzo.com>


On 11/3/26 07:17, Andrey Zhadchenko wrote:
> pb_timer_func() checks pb->deadline_jiffies every time it fires,
> so we actually don't need to re-arm the timer after setting the
> filed.
filed - > field?
>
> This is also the only place that arms the timer outside the window
> push_backup_stop() waits for with synchronize_rcu(). 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_try() once
> the write path is reachable without the rwsem (next patches).
>
> https://virtuozzo.atlassian.net/browse/VSTOR-152912
> Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
> ---
> v2: no changes
> v3: no changes
>
>   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 1ae4ccc208ffa..8ce84a1a696e5 100644
> --- a/drivers/md/dm-push-backup.c
> +++ b/drivers/md/dm-push-backup.c
> @@ -467,8 +467,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)
> @@ -519,8 +519,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;
> @@ -529,11 +528,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, pb->timeout_in_jiffies + 1);
> -	}
>   
>   	return 0;
>   }
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-11-03  6:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  6:17 [Devel] [PATCH hci-8.1 v3 0/6] dm/push_backup: event fd interface and fixes Andrey Zhadchenko
2026-11-03  6:17 ` [Devel] [PATCH hci-8.1 v3 1/6] drivers/md/push_backup: correct initialization Andrey Zhadchenko
2026-11-03  6:25   ` no-reply
2026-11-03  6:17 ` [Devel] [PATCH hci-8.1 v3 2/6] drivers/md/push_backup: clear pb->alive under pb->lock Andrey Zhadchenko
2026-11-03  6:25   ` no-reply
2026-11-03  6:17 ` [Devel] [PATCH hci-8.1 v3 3/6] drivers/md/push_backup: do not re-arm deadline timer in push_backup_write() Andrey Zhadchenko
2026-11-03  6:26   ` no-reply
2026-11-03  6:49   ` Alexander Ivanov [this message]
2026-11-03  6:17 ` [Devel] [PATCH hci-8.1 v3 4/6] drivers/md/push_backup: fix mod_timer() usage Andrey Zhadchenko
2026-11-03  6:26   ` no-reply
2026-11-03  6:53   ` Alexander Ivanov
2026-11-03  6:17 ` [Devel] [PATCH hci-8.1 v3 5/6] drivers/md/push_backup: arm deadline timer under pb->lock Andrey Zhadchenko
2026-11-03  6:28   ` no-reply
2026-11-03  6:17 ` [Devel] [PATCH hci-8.1 v3 6/6] drivers/md/push_backup: add event file descriptor interface Andrey Zhadchenko
2026-11-03  6:31   ` no-reply
2026-11-03  6:41     ` Andrey Zhadchenko
2026-11-03  7:06   ` Alexander Ivanov
2026-11-03  7:34 ` [Devel] [PATCH hci-8.1 v3 0/6] dm/push_backup: event fd interface and fixes Alexander Ivanov

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=c4bdc67f-4931-4f8b-a29b-46d0e296afac@virtuozzo.com \
    --to=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@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