All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	dm-devel@lists.linux.dev, Martin Wilck <mwilck@suse.com>
Subject: Re: [PATCH v2 08/14] multipathd: don't call reload_and_sync_map() from deferred_failback_tick()
Date: Thu, 19 Dec 2024 17:04:22 -0500	[thread overview]
Message-ID: <Z2SYZtAkLuqK-h6x@redhat.com> (raw)
In-Reply-To: <20241211225909.298770-9-mwilck@suse.com>

On Wed, Dec 11, 2024 at 11:59:03PM +0100, Martin Wilck wrote:
> Instead, move the call inside the existing loop over vecs->mpvec and call
> reload_and_sync_map() from checker_finished(). Note that we can't simply
> put the call deferred_failback_tick() in the "if" condition, because we
> need to adjust the ticks even if update_mpp_prio() returns true. For
> consistency, use separate bool variables for each condition that would
> necessitate a reload.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  multipathd/main.c | 39 ++++++++++++++-------------------------
>  1 file changed, 14 insertions(+), 25 deletions(-)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index b045f8b..b1f0f81 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -2076,32 +2076,20 @@ ghost_delay_tick(struct vectors *vecs)
>  	}
>  }
>  
> -static void
> -deferred_failback_tick (struct vectors *vecs)
> +static bool deferred_failback_tick(struct multipath *mpp)
>  {
> -	struct multipath * mpp;
> -	int i;
>  	bool need_reload;
>  
> -	vector_foreach_slot (vecs->mpvec, mpp, i) {
> -		/*
> -		 * deferred failback getting sooner
> -		 */
> -		if (mpp->pgfailback > 0 && mpp->failback_tick > 0) {
> -			mpp->failback_tick--;
> +	if (mpp->pgfailback <= 0 || mpp->failback_tick <= 0)
> +		return false;
>  
> -			if (!mpp->failback_tick &&
> -			    need_switch_pathgroup(mpp, &need_reload)) {
> -				if (need_reload) {
> -					if (reload_and_sync_map(mpp, vecs) == 2) {
> -						/* multipath device removed */
> -						i--;
> -					}
> -				} else
> -					switch_pathgroup(mpp);
> -			}
> -		}
> -	}
> +	mpp->failback_tick--;
> +	if (!mpp->failback_tick &&
> +	    need_switch_pathgroup(mpp, &need_reload) &&
> +	    need_reload)
> +		return true;
> +	else

If (!mpp->failback_tick && need_switch_pathgroup(mpp, &need_reload) is
true by need_reload isn't, don't we still need to call
switch_pathgroup(mpp);

-Ben

> +		return false;
>  }
>  
>  static void
> @@ -2973,11 +2961,13 @@ static void checker_finished(struct vectors *vecs, unsigned int ticks)
>  	int i;
>  
>  	vector_foreach_slot(vecs->mpvec, mpp, i) {
> -		bool inconsistent;
> +		bool inconsistent, prio_reload, failback_reload;
>  
>  		sync_mpp(vecs, mpp, ticks);
>  		inconsistent = mpp->need_reload;
> -		if (update_mpp_prio(mpp) || inconsistent)
> +		prio_reload = update_mpp_prio(mpp);
> +		failback_reload = deferred_failback_tick(mpp);
> +		if (prio_reload || failback_reload || inconsistent)
>  			if (reload_and_sync_map(mpp, vecs) == 2) {
>  				/* multipath device deleted */
>  				i--;
> @@ -2990,7 +2980,6 @@ static void checker_finished(struct vectors *vecs, unsigned int ticks)
>  		if (inconsistent)
>  			mpp->sync_tick = 1;
>  	}
> -	deferred_failback_tick(vecs);
>  	retry_count_tick(vecs->mpvec);
>  	missing_uev_wait_tick(vecs);
>  	ghost_delay_tick(vecs);
> -- 
> 2.47.0


  reply	other threads:[~2024-12-19 22:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 22:58 [PATCH v2 00/14] multipathd: More map reload handling, and checkerloop work Martin Wilck
2024-12-11 22:58 ` [PATCH v2 01/14] multipathd: don't reload map in update_mpp_prio() Martin Wilck
2024-12-11 22:58 ` [PATCH v2 02/14] multipathd: remove dm_get_info() call from refresh_multipath() Martin Wilck
2024-12-11 22:58 ` [PATCH v2 03/14] multipathd: sync maps at end of checkerloop Martin Wilck
2024-12-19 21:50   ` Benjamin Marzinski
2025-01-17 19:04     ` Martin Wilck
2024-12-19 23:04   ` Benjamin Marzinski
2025-01-14 21:36     ` Martin Wilck
2025-01-15 16:45       ` Benjamin Marzinski
2024-12-11 22:58 ` [PATCH v2 04/14] multipathd: quickly re-sync if a map is inconsistent Martin Wilck
2024-12-19 21:57   ` Benjamin Marzinski
2025-01-14 21:37     ` Martin Wilck
2025-01-15 18:48       ` Benjamin Marzinski
2024-12-19 23:05   ` Benjamin Marzinski
2024-12-11 22:59 ` [PATCH v2 05/14] multipathd: move yielding for waiters to start of checkerloop Martin Wilck
2024-12-11 22:59 ` [PATCH v2 06/14] multipathd: add checker_finished() Martin Wilck
2024-12-11 22:59 ` [PATCH v2 07/14] multipathd: move "tick" calls into checker_finished() Martin Wilck
2024-12-11 22:59 ` [PATCH v2 08/14] multipathd: don't call reload_and_sync_map() from deferred_failback_tick() Martin Wilck
2024-12-19 22:04   ` Benjamin Marzinski [this message]
2025-01-14 21:40     ` Martin Wilck
2024-12-11 22:59 ` [PATCH v2 09/14] multipathd: move retry_count_tick() into existing mpvec loop Martin Wilck
2024-12-11 22:59 ` [PATCH v2 10/14] multipathd: don't call update_map() from missing_uev_wait_tick() Martin Wilck
2024-12-11 22:59 ` [PATCH v2 11/14] multipathd: don't call udpate_map() from ghost_delay_tick() Martin Wilck
2024-12-11 22:59 ` [PATCH v2 12/14] multipathd: only call reload_and_sync_map() when ghost delay expires Martin Wilck
2024-12-11 22:59 ` [PATCH v2 13/14] multipathd: remove non-existent maps in checkerloop Martin Wilck
2024-12-11 22:59 ` [PATCH v2 14/14] multipathd: remove mpvec_garbage_collector() Martin Wilck
2024-12-19 22:33 ` [PATCH v2 00/14] multipathd: More map reload handling, and checkerloop work Benjamin Marzinski

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=Z2SYZtAkLuqK-h6x@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=martin.wilck@suse.com \
    --cc=mwilck@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.