From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
device-mapper development <dm-devel@lists.linux.dev>
Subject: Re: [PATCH v2 12/22] multipathd: split check_paths into two functions
Date: Tue, 8 Oct 2024 15:16:11 -0400 [thread overview]
Message-ID: <ZwWE--JLpEMyqOwx@redhat.com> (raw)
In-Reply-To: <eb63e364321e7af634dc9aa8296e1820d3355e45.camel@suse.com>
On Thu, Oct 03, 2024 at 10:41:20PM +0200, Martin Wilck wrote:
> On Thu, 2024-09-12 at 17:49 -0400, Benjamin Marzinski wrote:
> > Instead of checking and updating each path, the checkerloop now
> > starts
> > the checkers on all the paths in check_paths(), and then goes back
> > and
> > updates all the paths in update_paths(). Since the async checkers use
> > an
> > absolute time to wait for before returning PATH_PENDING, only one
> > checker actually needs to be waited for in update_paths(). The rest
> > will
> > already have reached their timeout when update_path() is called for
> > them.
> >
> > The check_paths() and update_paths() loop over the pathvec instead of
> > looping through the multipath device paths to avoid having to restart
> > checking of the device paths when the multipath device needs to be
> > resynced while updating the paths.
> >
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> > ---
> > libmultipath/structs.h | 10 +++-
> > multipathd/main.c | 105 +++++++++++++++++++--------------------
> > --
> > 2 files changed, 57 insertions(+), 58 deletions(-)
> >
> > diff --git a/libmultipath/structs.h b/libmultipath/structs.h
> > index d8231e95..af8e31e9 100644
> > --- a/libmultipath/structs.h
> > +++ b/libmultipath/structs.h
> > @@ -314,6 +314,14 @@ enum recheck_wwid_states {
> > RECHECK_WWID_ON = YNU_YES,
> > };
> >
> > +enum check_path_states {
> > + CHECK_PATH_UNCHECKED,
> > + CHECK_PATH_STARTED,
> > + CHECK_PATH_CHECKED,
> > + CHECK_PATH_SKIPPED,
> > + CHECK_PATH_REMOVED,
> > +};
> > +
> > struct vpd_vendor_page {
> > int pg;
> > const char *name;
> > @@ -395,7 +403,7 @@ struct path {
> > int fast_io_fail;
> > unsigned int dev_loss;
> > int eh_deadline;
> > - bool is_checked;
> > + enum check_path_states is_checked;
> > bool can_use_env_uid;
> > unsigned int checker_timeout;
> > /* configlet pointers */
> > diff --git a/multipathd/main.c b/multipathd/main.c
> > index 45d40559..9519b6c5 100644
> > --- a/multipathd/main.c
> > +++ b/multipathd/main.c
> > @@ -2389,13 +2389,6 @@ sync_mpp(struct vectors * vecs, struct
> > multipath *mpp, unsigned int ticks)
> > do_sync_mpp(vecs, mpp);
> > }
> >
> > -enum check_path_return {
> > - CHECK_PATH_STARTED,
> > - CHECK_PATH_CHECKED,
> > - CHECK_PATH_SKIPPED,
> > - CHECK_PATH_REMOVED,
> > -};
> > -
> > static int
> > update_path_state (struct vectors * vecs, struct path * pp)
> > {
> > @@ -2735,6 +2728,7 @@ check_uninitialized_path(struct path * pp,
> > unsigned int ticks)
> > conf = get_multipath_config();
> > retrigger_tries = conf->retrigger_tries;
> > pp->tick = conf->max_checkint;
> > + pp->checkint = conf->checkint;
> > put_multipath_config(conf);
> >
> > if (pp->initialized == INIT_MISSING_UDEV) {
> > @@ -2778,6 +2772,10 @@ update_uninitialized_path(struct vectors *
> > vecs, struct path * pp)
> > int newstate, ret;
> > struct config *conf;
> >
> > + if (pp->initialized != INIT_NEW && pp->initialized !=
> > INIT_FAILED &&
> > + pp->initialized != INIT_MISSING_UDEV)
> > + return CHECK_PATH_SKIPPED;
> > +
> > newstate = get_new_state(pp);
> >
>
> It seems to me that this hunk and the previous one belong into 11/22.
Setting pp->checkint could certainly go in the earlier patch. It's just
there to match check_path(), although to be honest, I'm still not sure
that there is any way for either check_path() or
check_uninitialized_path() to get called with pp->checkint unset.
The checking the path->initialized state in update_uninitialized_path()
makes less sense. That code is already in check_unintialized_path(). In
11/22, update_uninitialized_path() is always called immediately after
check_unintialized_path() if it's called at all, and pp->initialized
never has a chance to change.
In this patch, check_unintialized_path() is called in check_paths(), and
it's possible that path checking takes too long, and we need take a
break and yield to other vecs lock waiters before we call
update_paths(), where update_uninitialized_path() is called. In this
case, it's possible that a uevent got processed and changed
pp->initialized, so we need to recheck it in
update_uninitialized_path().
-Ben
> Martin
next prev parent reply other threads:[~2024-10-08 19:16 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 21:49 [PATCH v2 00/22] Yet Another path checker refactor Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 01/22] libmultipath: store checker_check() result in checker struct Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 02/22] libmultipath: add missing checker function prototypes Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 03/22] libmultipath: split out the code to wait for pending checkers Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 04/22] libmultipath: remove pending wait code from libcheck_check calls Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 05/22] multipath-tools tests: fix up directio tests Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 06/22] libmultipath: split get_state into two functions Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 07/22] libmultipath: change path_offline to path_sysfs_state Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 08/22] multipathd: split check_path_state into two functions Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 09/22] multipathd: split do_checker_path Benjamin Marzinski
2024-10-03 20:23 ` Martin Wilck
2024-10-08 18:18 ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 10/22] multipathd: split check_path into two functions Benjamin Marzinski
2024-10-03 20:23 ` Martin Wilck
2024-10-08 18:29 ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 11/22] multipathd: split handle_uninitialized_path " Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 12/22] multipathd: split check_paths " Benjamin Marzinski
2024-10-03 20:41 ` Martin Wilck
2024-10-08 19:16 ` Benjamin Marzinski [this message]
2024-09-12 21:49 ` [PATCH v2 13/22] multipathd: fix "fail path" and "reinstate path" commands Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 14/22] multipathd: update priority once after updating all paths Benjamin Marzinski
2024-10-03 21:00 ` Martin Wilck
2024-10-08 19:17 ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 15/22] multipathd: simplify checking for followover_should_failback Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 16/22] multipathd: only refresh prios on PATH_UP and PATH_GHOST Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 17/22] multipathd: remove pointless check Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 18/22] multipathd: fix deferred_failback_tick for reload removes Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 19/22] libmultipath: add libcheck_need_wait checker function Benjamin Marzinski
2024-10-03 21:15 ` Martin Wilck
2024-10-08 19:33 ` Benjamin Marzinski
2024-10-09 15:49 ` Martin Wilck
2024-10-14 17:48 ` Benjamin Marzinski
2024-10-14 21:08 ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 20/22] libmultipath: don't wait in libcheck_pending Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 21/22] multipathd: wait for checkers to complete Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 22/22] multipath-tools tests: fix up directio tests Benjamin Marzinski
2024-09-13 9:30 ` [PATCH v2 00/22] Yet Another path checker refactor Martin Wilck
2024-09-16 21:11 ` Benjamin Marzinski
2024-09-17 10:13 ` Martin Wilck
2024-10-03 21:23 ` Martin Wilck
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=ZwWE--JLpEMyqOwx@redhat.com \
--to=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@lists.linux.dev \
--cc=martin.wilck@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.