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 11/13] multipathd: don't call update_map() from missing_uev_wait_tick()
Date: Tue, 10 Dec 2024 18:13:33 -0500	[thread overview]
Message-ID: <Z1jLHaJVtbnQRwqk@redhat.com> (raw)
In-Reply-To: <20241206233617.382200-12-mwilck@suse.com>

On Sat, Dec 07, 2024 at 12:36:15AM +0100, Martin Wilck wrote:
> Instead, check for missing uevents in the existing mpvec loop.
> Note that if the uevent tick expires, we need to call update_map() rather than
> reload_and_sync_map(), because the paths have not been added to the multipath
> (see wait_for_udev handling ev_add_path()).
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  multipathd/main.c | 40 +++++++++++++++++++---------------------
>  1 file changed, 19 insertions(+), 21 deletions(-)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 4cf5493..4478cc9 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -2011,29 +2011,19 @@ followover_should_failback(struct multipath *mpp)
>  	return 0;
>  }
>  
> -static void
> -missing_uev_wait_tick(struct vectors *vecs)
> +/* Returns true if update_map() needs to be called */
> +static bool
> +missing_uev_wait_tick(struct multipath *mpp, bool *timed_out)
>  {
> -	struct multipath * mpp;
> -	int i;
> -	int timed_out = 0;
> +	if (mpp->wait_for_udev && --mpp->uev_wait_tick <= 0) {
> +		int wait = mpp->wait_for_udev;
>  
> -	vector_foreach_slot (vecs->mpvec, mpp, i) {
> -		if (mpp->wait_for_udev && --mpp->uev_wait_tick <= 0) {
> -			timed_out = 1;
> -			condlog(0, "%s: timeout waiting on creation uevent. enabling reloads", mpp->alias);
> -			if (mpp->wait_for_udev > 1 &&
> -			    update_map(mpp, vecs, 0)) {
> -				/* update_map removed map */
> -				i--;
> -				continue;
> -			}
> -			mpp->wait_for_udev = 0;
> -		}
> +		mpp->wait_for_udev = 0;
> +		*timed_out = true;
> +		condlog(0, "%s: timeout waiting on creation uevent. enabling reloads", mpp->alias);
> +		return wait > 1;
>  	}
> -
> -	if (timed_out && !need_to_delay_reconfig(vecs))
> -		unblock_reconfigure();
> +	return false;
>  }
>  
>  static void
> @@ -2947,9 +2937,16 @@ update_paths(struct vectors *vecs, int *num_paths_p, time_t start_secs)
>  static void checker_finished(struct vectors *vecs)
>  {
>  	struct multipath *mpp;
> +	bool uev_timed_out = false;
>  	int i;
>  
>  	vector_foreach_slot(vecs->mpvec, mpp, i) {
> +		if (missing_uev_wait_tick(mpp, &uev_timed_out) &&
> +		    update_map(mpp, vecs, 0)) {
> +			/* multipath device deleted */
> +			i--;
> +			continue;
> +		}

Looking at this made me think we should probably be adding a check
in reload_and_sync_map() for mpp->wait_for_udev. If it's no-zero,
we should set it to 2 (and we might want to make it symoblic too)
and skip the reload. Otherwise we'll be reloading when we shouldn't be.

>  		if ((update_mpp_prio(mpp) ||
>  		     (mpp->need_reload && mpp->synced_count > 0) ||
>  		     deferred_failback_tick(mpp)) &&
> @@ -2959,7 +2956,8 @@ static void checker_finished(struct vectors *vecs)
>  		else
>  			retry_count_tick(mpp);
>  	}
> -	missing_uev_wait_tick(vecs);
> +	if (uev_timed_out && !need_to_delay_reconfig(vecs))
> +		unblock_reconfigure();
>  	ghost_delay_tick(vecs);
>  	partial_retrigger_tick(vecs->pathvec);
>  }
> -- 
> 2.47.0


  reply	other threads:[~2024-12-10 23:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06 23:36 [PATCH 00/13] multipathd: More map reload handling, and checkerloop work Martin Wilck
2024-12-06 23:36 ` [PATCH 01/13] multipathd: don't reload map in update_mpp_prio() Martin Wilck
2024-12-06 23:36 ` [PATCH 02/13] multipathd: remove dm_get_info() call from refresh_multipath() Martin Wilck
2024-12-06 23:36 ` [PATCH 03/13] multipathd: allow map removal in do_sync_mpp() Martin Wilck
2024-12-10 19:02   ` Benjamin Marzinski
2024-12-10 19:44     ` Benjamin Marzinski
2024-12-10 21:05     ` Martin Wilck
2024-12-10 22:49       ` Benjamin Marzinski
2024-12-11 20:48         ` Martin Wilck
2024-12-10 23:30   ` Benjamin Marzinski
2024-12-11 12:06     ` Martin Wilck
2024-12-11 17:09       ` Benjamin Marzinski
2024-12-11 20:20         ` Martin Wilck
2024-12-11 20:33           ` Martin Wilck
2024-12-12 17:12             ` Benjamin Marzinski
2024-12-12 17:18               ` Martin Wilck
2024-12-12 17:50                 ` Benjamin Marzinski
2024-12-06 23:36 ` [PATCH 04/13] multipathd: reload maps in do_sync_mpp() if necessary Martin Wilck
2024-12-10 19:20   ` Benjamin Marzinski
2024-12-06 23:36 ` [PATCH 05/13] multipathd: move yielding for waiters to start of checkerloop Martin Wilck
2024-12-06 23:36 ` [PATCH 06/13] multipathd: add checker_finished() Martin Wilck
2024-12-06 23:36 ` [PATCH 07/13] multipathd: move "tick" calls into checker_finished() Martin Wilck
2024-12-06 23:36 ` [PATCH 08/13] multipathd: remove mpvec_garbage_collector() Martin Wilck
2024-12-10 23:34   ` Benjamin Marzinski
2024-12-06 23:36 ` [PATCH 09/13] multipathd: don't call reload_and_sync_map() from deferred_failback_tick() Martin Wilck
2024-12-06 23:36 ` [PATCH 10/13] multipathd: move retry_count_tick() into existing mpvec loop Martin Wilck
2024-12-06 23:36 ` [PATCH 11/13] multipathd: don't call update_map() from missing_uev_wait_tick() Martin Wilck
2024-12-10 23:13   ` Benjamin Marzinski [this message]
2024-12-06 23:36 ` [PATCH 12/13] multipathd: don't call udpate_map() from ghost_delay_tick() Martin Wilck
2024-12-06 23:36 ` [PATCH 13/13] multipathd: only call reload_and_sync_map() when ghost delay expires Martin Wilck
2024-12-11  0:02 ` [PATCH 00/13] 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=Z1jLHaJVtbnQRwqk@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.