From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
Brian Bunker <brian@purestorage.com>,
dm-devel@lists.linux.dev,
Xose Vazquez Perez <xose.vazquez@gmail.com>,
Martin Wilck <mwilck@suse.com>
Subject: Re: [PATCH 09/18] libmultipath: add generic async path checker code
Date: Tue, 12 May 2026 20:55:51 -0400 [thread overview]
Message-ID: <agPMFwUEqNoOE8w5@redhat.com> (raw)
In-Reply-To: <20260505154332.448054-10-mwilck@suse.com>
On Tue, May 05, 2026 at 05:43:23PM +0200, Martin Wilck wrote:
> Add a framework for an asynchronous path checker utilizing the
> recently added runner code for thread handling.
>
> This code has been derived from the TUR checker code by removing
> all references to the actual sending of TUR ioctls.
>
> Follow-up patches will convert the current TUR checker into an
> instance of this async checker class.
>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
> libmultipath/Makefile | 2 +-
> libmultipath/async_checker.c | 216 +++++++++++++++++++++++++++++++++++
> libmultipath/async_checker.h | 35 ++++++
> libmultipath/checkers.c | 1 +
> libmultipath/checkers.h | 2 +
> 5 files changed, 255 insertions(+), 1 deletion(-)
> create mode 100644 libmultipath/async_checker.c
> create mode 100644 libmultipath/async_checker.h
>
[...]
> diff --git a/libmultipath/async_checker.h b/libmultipath/async_checker.h
> new file mode 100644
> index 0000000..835de2a
> --- /dev/null
> +++ b/libmultipath/async_checker.h
> @@ -0,0 +1,35 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// Copyright (c) 2026 SUSE LLC
> +#ifndef ASYNC_CHECKER_H_INCLUDED
> +#define ASYNC_CHECKER_H_INCLUDED
> +
> +struct runner_data;
> +struct checker;
> +typedef int (*async_checker_func)(struct runner_data *);
> +
> +struct runner_data {
> + int fd;
> + dev_t devt;
> + async_checker_func afunc;
> + unsigned int timeout;
> + int state;
> + short msgid;
> + char checker_ctx[];
checker_ctx should be probably be aligned.
-Ben
> +};
> +
> +int async_check_init(struct checker *c);
> +void async_check_free(struct checker *c);
> +bool async_check_need_wait(struct checker *c);
> +int async_check_pending(struct checker *c);
> +int async_check_check(struct checker *c);
> +
> +#define CHECKER_MAX_CONTEXT_SIZE 1024
> +
> +/* For testing handling of async checker timeouts */
> +#ifdef ASYNC_TEST_MAJOR
> +static void async_deep_sleep(const struct runner_data *rdata);
> +#else
> +#define async_deep_sleep(x) do {} while (0)
> +#endif
> +
> +#endif
> diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c
> index a3b9cc8..3a1663f 100644
> --- a/libmultipath/checkers.c
> +++ b/libmultipath/checkers.c
> @@ -9,6 +9,7 @@
>
> #include "debug.h"
> #include "checkers.h"
> +#include "async_checker.h"
> #include "vector.h"
> #include "util.h"
>
> diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h
> index 630e987..744be54 100644
> --- a/libmultipath/checkers.h
> +++ b/libmultipath/checkers.h
> @@ -132,6 +132,7 @@ enum {
> };
>
> struct checker;
> +struct runner_data;
> struct checker_class {
> struct list_head node;
> void *handle;
> @@ -144,6 +145,7 @@ struct checker_class {
> void (*reset)(void); /* to reset the global variables */
> int (*pending)(struct checker *); /* to recheck pending paths */
> bool (*need_wait)(struct checker *); /* checker needs waiting for */
> + int (*async_func)(struct runner_data *); /* callback for async_checker */
> const char **msgtable;
> short msgtable_size;
> };
> --
> 2.54.0
next prev parent reply other threads:[~2026-05-13 0:55 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 15:43 [PATCH 00/18] multipath-tools: asynchronous checker framework Martin Wilck
2026-05-05 15:43 ` [PATCH 01/18] libmpathutil: runner: reduce a message loglevel Martin Wilck
2026-05-13 0:39 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 02/18] libmultipath: checkers: add two generic checker messages Martin Wilck
2026-05-13 0:39 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 03/18] libmultipath: checkers: move checker_class definition to checkers.h Martin Wilck
2026-05-13 0:40 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 04/18] libmpathutil: add implementation of generic shared pointer Martin Wilck
2026-05-13 0:45 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 05/18] multipath-tools tests: add tests for shared pointer code Martin Wilck
2026-05-08 23:11 ` Martin Wilck
2026-05-05 15:43 ` [PATCH 06/18] libmultipath: use shared_ptr for checker classes Martin Wilck
2026-05-13 0:49 ` Benjamin Marzinski
2026-05-17 9:57 ` Martin Wilck
2026-05-18 19:27 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 07/18] libmultipath: use shared_ptr for prioritizers Martin Wilck
2026-05-13 0:50 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 08/18] libmpathutil: runner: use shared_ptr Martin Wilck
2026-05-13 0:50 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 09/18] libmultipath: add generic async path checker code Martin Wilck
2026-05-13 0:55 ` Benjamin Marzinski [this message]
2026-05-05 15:43 ` [PATCH 10/18] libmultipath: checkers: add support for async checker Martin Wilck
2026-05-13 0:59 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 11/18] libmultipath: convert TUR checker to an async checker instance Martin Wilck
2026-05-13 1:03 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 12/18] libmultipath: convert RDAC checker to async checker Martin Wilck
2026-05-13 1:04 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 13/18] libmultipath: convert cciss_tur " Martin Wilck
2026-05-13 1:05 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 14/18] libmultipath: convert readsector0 " Martin Wilck
2026-05-13 1:05 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 15/18] libmultipath: convert hp_sw " Martin Wilck
2026-05-13 1:06 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 16/18] libmultipath: async_checker: add context_size and init symbols Martin Wilck
2026-05-13 1:09 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 17/18] libmultipath: checkers: rework mpcontext passing Martin Wilck
2026-05-13 1:09 ` Benjamin Marzinski
2026-05-05 15:43 ` [PATCH 18/18] libmultipath: convert emc_clariion to async_checker Martin Wilck
2026-05-13 1:20 ` 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=agPMFwUEqNoOE8w5@redhat.com \
--to=bmarzins@redhat.com \
--cc=brian@purestorage.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@lists.linux.dev \
--cc=martin.wilck@suse.com \
--cc=mwilck@suse.com \
--cc=xose.vazquez@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox