Skip to content

multipath-tools: asynchronous checker framework

Martin Wilck dm-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest19 patches 10 repliesIn review
  2. v118 patches 20 repliesSuperseded

Changes in v2 from the cover letter

- Patch 05: rework the shared_ptr test
- Patch 06: new, separate patch for removing libcheck_tread code; remove libcheck_thread and start_checker_thread() from checkers.h Following patches are renumbered
- Patch 10 (was 09): add alignment for checker_ctx field in struct runner_data remove the unused chkr field from struct async_checker_context
- Patch 12: remove struct checker_context from checkers.h,
remove unused MSG_TUR_FAILED,
- patch 16: rename checker symbols to "libcheck_async_context_size" and "libcheck_async_init"
- Patch 17 (was 12): Try to set TAS bit in rdac checker (libcheck_async_init()); this requires moving it after patch 16

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19libmpathutil: runner: reduce a message loglevellibmpathutil/runner.c+1 -10 replies
2/19libmultipath: checkers: add two generic checker messageslibmultipath/checkers.c libmultipath/checkers.h+4 -00 replies
3/19libmultipath: checkers: move checker_class definition to checkers.hlibmultipath/checkers.c libmultipath/checkers.h+19 -190 replies
4/19libmpathutil: add implementation of generic shared pointerlibmpathutil/libmpathutil.version libmpathutil/util.c libmpathutil/util.h+53 -44 replies
5/19multipath-tools tests: add tests for shared pointer codetests/Makefile tests/shared_ptr.c+123 -10 replies
6/19libmultipath: remove libcheck_thread related codelibmultipath/checkers.c libmultipath/checkers.h libmultipath/libmultipath.version+2 -610 replies
7/19libmultipath: use shared_ptr for checker classeslibmultipath/checkers.c libmultipath/checkers.h+19 -410 replies
8/19libmultipath: use shared_ptr for prioritizerslibmultipath/prio.c libmultipath/prio.h+20 -280 replies
9/19libmpathutil: runner: use shared_ptrlibmpathutil/runner.c+9 -215 replies
10/19libmultipath: add generic async path checker codelibmultipath/Makefile libmultipath/async_checker.c libmultipath/async_checker.h +2 more+253 -10 replies
11/19libmultipath: checkers: add support for async checkerlibmultipath/checkers.c libmultipath/libmultipath.version+36 -170 replies
12/19libmultipath: convert TUR checker to an async checker instancelibmultipath/checkers.h libmultipath/checkers/tur.c+15 -2410 replies
13/19libmultipath: convert cciss_tur checker to async checkerlibmultipath/checkers/cciss_tur.c+10 -310 replies
14/19libmultipath: convert readsector0 checker to async checkerlibmultipath/checkers/readsector0.c+7 -210 replies
15/19libmultipath: convert hp_sw checker to async checkerlibmultipath/checkers/hp_sw.c+8 -240 replies
16/19libmultipath: async_checker: add context_size and init symbolslibmultipath/async_checker.c+29 -20 replies
17/19libmultipath: convert RDAC checker to async checkerlibmultipath/checkers/rdac.c+14 -240 replies
18/19libmultipath: checkers: rework mpcontext passinglibmultipath/async_checker.c libmultipath/async_checker.h libmultipath/checkers.c +8 more+100 -1000 replies
19/19libmultipath: convert emc_clariion to async_checkerlibmultipath/checkers/emc_clariion.c+33 -460 replies

Reviews trailers per patch

11 of 19 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBenjamin Marzinski
SeriesR-b
1/19R-b
2/19R-b
3/19R-b
4/19R-b
5/19
6/19
7/19
8/19R-b
9/19R-b
10/19
11/19R-b
12/19
13/19R-b
14/19R-b
15/19R-b
16/19
17/19
18/19R-b
19/19

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/19] multipath-tools: asynchronous checker framework

Based on my previous patch set [1], which introduced the "runner" thread handling code as an abstract implementation of the asynchronous checker logic in the TUR checker, this set introduces a generic "async_checker" type and converts all existing checkers except directio to this framework. With this set applied, all checkers run asyncrhonously unless explicitly forbidden to do so with the "force_sync" option.

Patch 1-3 are minor preparations. Patch 4-8 introduce a general concept of a refcounted "shared" pointer and use it to replace multiple instances of hard-coded refcounts on objects. Patch 9 converts the current TUR code into a generic asynchronous checker type by separating the actual TUR code from the handling of the async runners. Patch 10 adds support for this async checker type in the checkers code by searching for "libcheck_async_func" with dlsym() in checker DSOs. Patch 11-15 convert all checkers except emc_clariion to the async_checker framework. emc_clariion is special because it needs extra context both for the checker itself and for multipath-related information. Patch 16 and 17 add the respective additional fields to the async_checker framework. The mpcontext handling is rewritten, because the current apporach of handling void ** pointers would be disastrous in scenarious with truly asynchronous checker threads that may hang forever. Patch 18 finally converts emc_clariion, using the concepts from patch 16 and 17.

Comments and reviews welcome.

Regards,
Martin

[1] https://lore.kernel.org/dm-devel/[email protected]/T/#m9369993a81c82b10ef42896505d4a354b6be3f79

Changes v1 -> v2 (suggestions by Ben Marzinski)

- Patch 05: rework the shared_ptr test
- Patch 06: new, separate patch for removing libcheck_tread code; remove libcheck_thread and start_checker_thread() from checkers.h Following patches are renumbered
- Patch 10 (was 09): add alignment for checker_ctx field in struct runner_data remove the unused chkr field from struct async_checker_context
- Patch 12: remove struct checker_context from checkers.h,
remove unused MSG_TUR_FAILED,
- patch 16: rename checker symbols to "libcheck_async_context_size" and "libcheck_async_init"
- Patch 17 (was 12): Try to set TAS bit in rdac checker (libcheck_async_init()); this requires moving it after patch 16

Martin Wilck (19):
libmpathutil: runner: reduce a message loglevel
libmultipath: checkers: add two generic checker messages
libmultipath: checkers: move checker_class definition to checkers.h
libmpathutil: add implementation of generic shared pointer multipath-tools tests: add tests for shared pointer code
libmultipath: remove libcheck_thread related code
libmultipath: use shared_ptr for checker classes
libmultipath: use shared_ptr for prioritizers
libmpathutil: runner: use shared_ptr
libmultipath: add generic async path checker code
libmultipath: checkers: add support for async checker
libmultipath: convert TUR checker to an async checker instance
libmultipath: convert cciss_tur checker to async checker
libmultipath: convert readsector0 checker to async checker
libmultipath: convert hp_sw checker to async checker
libmultipath: async_checker: add context_size and init symbols
libmultipath: convert RDAC checker to async checker
libmultipath: checkers: rework mpcontext passing
libmultipath: convert emc_clariion to async_checker

 libmpathutil/libmpathutil.version    |   7 +
 libmpathutil/runner.c                |  32 ++--
 libmpathutil/util.c                  |  45 ++++-
 libmpathutil/util.h                  |   5 +
 libmultipath/Makefile                |   2 +-
 libmultipath/async_checker.c         | 249 ++++++++++++++++++++++++++
 libmultipath/async_checker.h         |  36 ++++
 libmultipath/checkers.c              | 236 +++++++++----------------
 libmultipath/checkers.h              |  79 +++++----
 libmultipath/checkers/cciss_tur.c    |  41 ++---
 libmultipath/checkers/directio.c     |   6 +-
 libmultipath/checkers/emc_clariion.c | 104 +++++------
 libmultipath/checkers/hp_sw.c        |  32 +---
 libmultipath/checkers/rdac.c         |  38 ++--
 libmultipath/checkers/readsector0.c  |  28 +--
 libmultipath/checkers/tur.c          | 253 ++-------------------------
 libmultipath/discovery.c             |   8 +-
 libmultipath/libmultipath.version    |   3 +-
 libmultipath/prio.c                  |  47 +++--
 libmultipath/prio.h                  |   1 -
 libmultipath/structs.c               |   3 +-
 libmultipath/structs.h               |   3 +-
 tests/Makefile                       |   4 +-
 tests/directio.c                     |   2 +-
 tests/shared_ptr.c                   | 120 +++++++++++++
 25 files changed, 728 insertions(+), 656 deletions(-)
 create mode 100644 libmultipath/async_checker.c
 create mode 100644 libmultipath/async_checker.h
 create mode 100644 tests/shared_ptr.c
Signature · 1 line
2.54.0