git: 78c9d8f1ce65 - releng/14.1 - zfs: merge openzfs/zfs@256659204 (zfs-2.2-release) into stable/14

From: Martin Matuska <mm_at_FreeBSD.org>
Date: Wed, 08 May 2024 15:25:52 UTC
The branch releng/14.1 has been updated by mm:

URL: https://cgit.FreeBSD.org/src/commit/?id=78c9d8f1ce655f10368c06272f5e320b8a263612

commit 78c9d8f1ce655f10368c06272f5e320b8a263612
Author:     Martin Matuska <mm@FreeBSD.org>
AuthorDate: 2024-05-03 21:51:01 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2024-05-08 15:24:29 +0000

    zfs: merge openzfs/zfs@256659204 (zfs-2.2-release) into stable/14
    
    OpenZFS release 2.2.4
    
    Notable upstream pull request merges:
     #15076 fdd97e009 Refactor dmu_prefetch()
     #15225 5972bb856 Use ASSERT0P() to check that a pointer is NULL
     #15381 7ea833100 ZIL: Detect single-threaded workloads
     #15515 8b1a132de ZIO: Optimize zio_flush()
     #15225 d6da6cbd7 Clean up existing VERIFY*() macros
     #15225 5dda8c091 Add VERIFY0P() and ASSERT0P() macros
     #15436 61f3638a3 Add prefetch property
     #15509 6f323353d Add ashift validation when adding devices to a pool
     #15539 ea3f7c12a Extend import_progress kstat with a notes field
     #15635 25ea8ce94 ZIL: Improve next log block size prediction
     #15784 16c223eec Do no use .cfi_negate_ra_state within the assembly on
                      Arm64
     #15839 706307445 vdev probe to slow disk can stall mmp write checker
     #15879 86b39b41a zpool: Fix locale-specific time
     #15927 fa5de0c5c Update resume token at object receive
     #15941 fdd8c0aea BRT: Skip duplicate BRT prefetches
     #15942 889152ce4 Give better message from 'zpool get' with invalid pool
                      name
     #15950 3e91a9c52 BRT: Skip getting length in brt_entry_lookup()
     #15951 19bf54b76 ZAP: Massively switch to _by_dnode() interfaces
     #15954 f7c1db636 BRT: Change brt_pending_tree sorting order
     #15955 457e62d7c BRT: Relax brt_pending_apply() locking
     #15967 c94f73007 BRT: Make BRT block sizes configurable
     #15976 dced953b6 ZAP: Some cleanups/micro-optimizations
     #15983 531572b59 Fix panics when truncating/deleting files
     #15992 5fc134ff2 zvol: use multiple taskq
     #16007 2ea370a4e BRT: Fix holes cloning
     #16008 67995229a zpool: Fix option string, adding -e and fixing order
     #16015 8a5604713 Add support for zfs mount -R <filesystem>
     #16022 026fe7964 Speculative prefetch for reordered requests
     #16040 575872cc3 L2ARC: Relax locking during write
     #16042 d5fb6abd3 Improve dbuf_read() error reporting
     #16051 5d859a2e2 xdr: header cleanup
     #16052 602b5dca7 Fix read errors race after block cloning
     #16057 97d7228f4 Remove db_state DB_NOFILL checks from syncing context
     #16072 f4ce02ae4 Small fix to prefetch ranges aggregation
     #16074 97889c037 return NULL at end of send_progress_thread
     #16086 7aaf6ce9d Add the BTI elf note to the AArch64 SHA2 assembly
     #16094 4d17e200d Add zfetch stats in arcstats
     #16128 3d4d61988 Fix updating the zvol_htable when renaming a zvol
     #16141 b3b37b84e Fix arcstats for FreeBSD after zfetch support
    
    Obtained from:  OpenZFS
    OpenZFS commit: 2566592045780e7be7afc899c2496b1ae3af4f4d
    OpenZFS tag:    zfs-2.2.4
    Approved by:    re (cperciva)
    
    (cherry picked from commit 9a5f0cb5b639f8e0435103d44b17eb8a352af990)
---
 cddl/lib/libnvpair/Makefile                        |   2 -
 sys/contrib/openzfs/.mailmap                       |  18 +
 sys/contrib/openzfs/AUTHORS                        |  35 +
 sys/contrib/openzfs/META                           |   4 +-
 sys/contrib/openzfs/cmd/arc_summary                |  11 +-
 sys/contrib/openzfs/cmd/arcstat.in                 |  57 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_api.c       |  57 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_api.h       |   3 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c      |   3 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h      |   2 +-
 sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c | 143 +++-
 sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c    |   3 +
 sys/contrib/openzfs/cmd/zfs/zfs_main.c             |  75 +-
 sys/contrib/openzfs/cmd/zinject/zinject.c          |  16 +
 .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c     |   4 +-
 sys/contrib/openzfs/cmd/zpool/zpool_main.c         | 146 ++--
 sys/contrib/openzfs/cmd/ztest.c                    |   8 +-
 sys/contrib/openzfs/config/Substfiles.am           |   3 +-
 sys/contrib/openzfs/config/always-pyzfs.m4         |   9 +-
 sys/contrib/openzfs/config/ax_python_devel.m4      | 341 +++++---
 sys/contrib/openzfs/config/kernel-blk-queue.m4     |  15 +
 sys/contrib/openzfs/config/kernel-blkdev.m4        | 159 +++-
 sys/contrib/openzfs/config/kernel-filemap.m4       |   1 +
 .../openzfs/config/kernel-make-request-fn.m4       |  33 +
 sys/contrib/openzfs/config/kernel-mm-page-size.m4  |  17 +
 .../openzfs/config/kernel-vfs-file_range.m4        |  27 +
 sys/contrib/openzfs/config/kernel.m4               |   4 +
 sys/contrib/openzfs/config/zfs-build.m4            |   8 +-
 sys/contrib/openzfs/contrib/debian/control         |   2 +-
 sys/contrib/openzfs/etc/init.d/README.md           |   6 +-
 sys/contrib/openzfs/etc/init.d/zfs-import.in       |   2 +-
 sys/contrib/openzfs/etc/init.d/zfs-load-key.in     |   2 +-
 sys/contrib/openzfs/etc/init.d/zfs-mount.in        |   2 +-
 sys/contrib/openzfs/etc/init.d/zfs-share.in        |   3 +-
 sys/contrib/openzfs/etc/init.d/zfs-zed.in          |   3 +-
 sys/contrib/openzfs/include/libzfs.h               |   6 +-
 sys/contrib/openzfs/include/os/freebsd/Makefile.am |   4 +-
 .../openzfs/include/os/freebsd/spl/rpc/xdr.h       |  71 --
 .../openzfs/include/os/freebsd/spl/sys/debug.h     |  40 +-
 sys/contrib/openzfs/include/os/linux/Makefile.am   |   2 +
 .../include/os/linux/kernel/linux/blkdev_compat.h  |   6 +-
 .../include/os/linux/kernel/linux/mm_compat.h      |  36 +
 .../include/os/linux/kernel/linux/mod_compat.h     |   1 +
 .../openzfs/include/os/linux/spl/rpc/types.h       |  30 +
 sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h |   2 -
 .../openzfs/include/os/linux/spl/sys/debug.h       |  38 +-
 .../openzfs/include/os/linux/spl/sys/taskq.h       |   2 +-
 .../openzfs/include/os/linux/zfs/sys/trace_zil.h   |  14 +-
 sys/contrib/openzfs/include/sys/abd.h              |   9 +
 sys/contrib/openzfs/include/sys/abd_impl.h         |  26 +-
 sys/contrib/openzfs/include/sys/dmu.h              |   5 +-
 sys/contrib/openzfs/include/sys/dmu_objset.h       |   1 +
 sys/contrib/openzfs/include/sys/dmu_zfetch.h       |  16 +-
 sys/contrib/openzfs/include/sys/fm/fs/zfs.h        |   2 +
 sys/contrib/openzfs/include/sys/fs/zfs.h           |  14 +-
 sys/contrib/openzfs/include/sys/multilist.h        |   5 +-
 sys/contrib/openzfs/include/sys/spa.h              |  12 +-
 sys/contrib/openzfs/include/sys/uberblock_impl.h   |  16 +-
 sys/contrib/openzfs/include/sys/vdev_impl.h        |   7 +-
 sys/contrib/openzfs/include/sys/zap.h              |   8 +
 sys/contrib/openzfs/include/sys/zap_impl.h         |   1 +
 sys/contrib/openzfs/include/sys/zap_leaf.h         |  10 +-
 sys/contrib/openzfs/include/sys/zil_impl.h         |  10 +-
 sys/contrib/openzfs/lib/libspl/include/assert.h    |  15 +-
 sys/contrib/openzfs/lib/libuutil/uu_list.c         |  14 +-
 sys/contrib/openzfs/lib/libzfs/libzfs.abi          |  84 +-
 sys/contrib/openzfs/lib/libzfs/libzfs_pool.c       |  13 +-
 sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c   |   1 +
 sys/contrib/openzfs/lib/libzfs/libzfs_util.c       |  12 +-
 .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c   |  10 +
 sys/contrib/openzfs/man/Makefile.am                |   4 +-
 sys/contrib/openzfs/man/man4/spl.4                 |  18 +-
 sys/contrib/openzfs/man/man4/zfs.4                 |  83 +-
 sys/contrib/openzfs/man/man7/vdevprops.7           |  12 +-
 sys/contrib/openzfs/man/man7/zfsprops.7            |  17 +
 sys/contrib/openzfs/man/man7/zpoolconcepts.7       |   4 +-
 sys/contrib/openzfs/man/man8/zfs-mount.8           |   6 +-
 sys/contrib/openzfs/man/man8/zinject.8             |   1 +
 sys/contrib/openzfs/man/man8/zpool-add.8           |  18 +-
 sys/contrib/openzfs/man/man8/zpool-clear.8         |   7 +-
 sys/contrib/openzfs/man/man8/zpool-status.8        |  18 +-
 .../icp/asm-aarch64/blake3/b3_aarch64_sse2.S       |  14 +-
 .../icp/asm-aarch64/blake3/b3_aarch64_sse41.S      |  12 +-
 .../module/icp/asm-aarch64/sha2/sha256-armv8.S     |  10 +
 .../module/icp/asm-aarch64/sha2/sha512-armv8.S     |  10 +
 sys/contrib/openzfs/module/nvpair/nvpair.c         |   1 +
 sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c |   4 +-
 .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c   |   4 +-
 .../openzfs/module/os/freebsd/zfs/zvol_os.c        |   2 +-
 .../openzfs/module/os/linux/spl/spl-taskq.c        |  85 +-
 sys/contrib/openzfs/module/os/linux/spl/spl-xdr.c  |   1 +
 sys/contrib/openzfs/module/os/linux/zfs/abd_os.c   | 123 ++-
 .../openzfs/module/os/linux/zfs/vdev_disk.c        | 913 ++++++++++++++++-----
 .../openzfs/module/os/linux/zfs/zfs_vnops_os.c     |  12 +-
 sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c |   8 +-
 .../openzfs/module/os/linux/zfs/zpl_file_range.c   |  16 +-
 sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c  | 140 +++-
 sys/contrib/openzfs/module/zcommon/zfs_prop.c      |  11 +
 sys/contrib/openzfs/module/zcommon/zpool_prop.c    |   6 +
 sys/contrib/openzfs/module/zfs/abd.c               |  42 +
 sys/contrib/openzfs/module/zfs/arc.c               | 179 ++--
 sys/contrib/openzfs/module/zfs/brt.c               | 147 +---
 sys/contrib/openzfs/module/zfs/dbuf.c              | 160 ++--
 sys/contrib/openzfs/module/zfs/dmu.c               | 149 ++--
 sys/contrib/openzfs/module/zfs/dmu_objset.c        |  29 +-
 sys/contrib/openzfs/module/zfs/dmu_recv.c          |  17 +-
 sys/contrib/openzfs/module/zfs/dmu_zfetch.c        | 296 +++++--
 sys/contrib/openzfs/module/zfs/dsl_deadlist.c      |   8 +-
 sys/contrib/openzfs/module/zfs/metaslab.c          |   8 +-
 sys/contrib/openzfs/module/zfs/mmp.c               |   5 +-
 sys/contrib/openzfs/module/zfs/multilist.c         |  26 +-
 sys/contrib/openzfs/module/zfs/spa.c               | 149 +++-
 sys/contrib/openzfs/module/zfs/spa_log_spacemap.c  |  16 +-
 sys/contrib/openzfs/module/zfs/spa_misc.c          |  74 +-
 sys/contrib/openzfs/module/zfs/txg.c               |   9 +
 sys/contrib/openzfs/module/zfs/vdev.c              |  52 +-
 sys/contrib/openzfs/module/zfs/vdev_label.c        |   4 +-
 sys/contrib/openzfs/module/zfs/vdev_raidz.c        |   5 +-
 sys/contrib/openzfs/module/zfs/zap.c               |  43 +-
 sys/contrib/openzfs/module/zfs/zap_leaf.c          |  77 +-
 sys/contrib/openzfs/module/zfs/zap_micro.c         | 206 +++--
 sys/contrib/openzfs/module/zfs/zfs_fm.c            |  26 +
 sys/contrib/openzfs/module/zfs/zfs_ioctl.c         |  13 +-
 sys/contrib/openzfs/module/zfs/zfs_vnops.c         |   6 +-
 sys/contrib/openzfs/module/zfs/zil.c               | 352 +++++---
 sys/contrib/openzfs/module/zfs/zio.c               |  42 +-
 sys/contrib/openzfs/module/zfs/zio_inject.c        |   6 +
 sys/contrib/openzfs/module/zfs/zvol.c              |   2 +-
 sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in    |   2 +-
 sys/contrib/openzfs/tests/runfiles/common.run      |   8 +-
 sys/contrib/openzfs/tests/runfiles/linux.run       |   5 +-
 sys/contrib/openzfs/tests/runfiles/sanity.run      |   3 +-
 .../openzfs/tests/zfs-tests/tests/Makefile.am      |   5 +
 .../tests/functional/bclone/bclone_common.kshlib   |  47 +-
 .../functional/bclone/bclone_corner_cases.kshlib   |  20 +-
 .../functional/cli_root/zfs_mount/zfs_mount.cfg    |   1 +
 .../cli_root/zfs_mount/zfs_mount_recursive.ksh     | 146 ++++
 .../functional/cli_root/zpool_add/add-o_ashift.ksh |  17 +-
 .../cli_root/zpool_add/add_prop_ashift.ksh         |  16 +-
 .../zpool_add/zpool_add--allow-ashift-mismatch.ksh |   0
 .../cli_root/zpool_add/zpool_add_002_pos.ksh       |  11 +
 .../cli_root/zpool_add/zpool_add_004_pos.ksh       |   2 +-
 .../cli_root/zpool_add/zpool_add_005_pos.ksh       |   2 +
 .../cli_root/zpool_add/zpool_add_009_neg.ksh       |   2 +
 .../cli_root/zpool_add/zpool_add_010_pos.ksh       |   2 +-
 .../functional/cli_root/zpool_get/vdev_get.cfg     |   2 +
 .../cli_root/zpool_import/zpool_import_status.ksh  | 132 +++
 .../tests/functional/cp_files/cp_files_002_pos.ksh |   6 +-
 .../zfs-tests/tests/functional/events/cleanup.ksh  |   4 +-
 .../tests/functional/events/zed_slow_io.ksh        | 205 +++++
 .../functional/events/zed_slow_io_many_vdevs.ksh   | 177 ++++
 .../zfs-tests/tests/functional/fault/cleanup.ksh   |   1 +
 .../zfs-tests/tests/functional/fault/setup.ksh     |   1 +
 .../tests/functional/mmp/mmp_write_slow_disk.ksh   |  97 +++
 .../user_namespace/user_namespace_004.ksh          |   4 +-
 sys/contrib/openzfs/udev/zvol_id.c                 |   9 +-
 sys/modules/zfs/zfs_config.h                       |  50 +-
 sys/modules/zfs/zfs_gitrev.h                       |   2 +-
 158 files changed, 4808 insertions(+), 1646 deletions(-)

diff --git a/cddl/lib/libnvpair/Makefile b/cddl/lib/libnvpair/Makefile
index fb80d7c22ea5..a93ffcbd00de 100644
--- a/cddl/lib/libnvpair/Makefile
+++ b/cddl/lib/libnvpair/Makefile
@@ -27,6 +27,4 @@ CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
 CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
 CFLAGS+= -DHAVE_ISSETUGID  -DHAVE_CONFIG_H -DHAVE_XDR_BYTESREC
 
-
-CFLAGS.nvpair.c+= -UHAVE_RPC_TYPES
 .include <bsd.lib.mk>
diff --git a/sys/contrib/openzfs/.mailmap b/sys/contrib/openzfs/.mailmap
index 46ef016b93f8..32bdb5209613 100644
--- a/sys/contrib/openzfs/.mailmap
+++ b/sys/contrib/openzfs/.mailmap
@@ -30,6 +30,7 @@ Andreas Dilger <adilger@dilger.ca>
 Andrew Walker <awalker@ixsystems.com>
 Benedikt Neuffer <github@itfriend.de>
 Chengfei Zhu <chengfeix.zhu@intel.com>
+ChenHao Lu <18302010006@fudan.edu.cn>
 Chris Lindee <chris.lindee+github@gmail.com>
 Colm Buckley <colm@tuatha.org>
 Crag Wang <crag0715@gmail.com>
@@ -43,6 +44,7 @@ Glenn Washburn <development@efficientek.com>
 Gordan Bobic <gordan.bobic@gmail.com>
 Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
 hedong zhang <h_d_zhang@163.com>
+Ilkka Sovanto <github@ilkka.kapsi.fi>
 InsanePrawn <Insane.Prawny@gmail.com>
 Jason Cohen <jwittlincohen@gmail.com>
 Jason Harmening <jason.harmening@gmail.com>
@@ -57,6 +59,7 @@ KernelOfTruth <kerneloftruth@gmail.com>
 Liu Hua <liu.hua130@zte.com.cn>
 Liu Qing <winglq@gmail.com>
 loli10K <ezomori.nozomu@gmail.com>
+Mart Frauenlob <allkind@fastest.cc>
 Matthias Blankertz <matthias@blankertz.org>
 Michael Gmelin <grembo@FreeBSD.org>
 Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
@@ -73,6 +76,9 @@ WHR <msl0000023508@gmail.com>
 Yanping Gao <yanping.gao@xtaotech.com>
 Youzhong Yang <youzhong@gmail.com>
 
+# Signed-off-by: overriding Author:
+Yuxin Wang <yuxinwang9999@gmail.com> <Bi11gates9999@gmail.com>
+
 # Commits from strange places, long ago
 Brian Behlendorf <behlendorf1@llnl.gov> <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
 Brian Behlendorf <behlendorf1@llnl.gov> <behlendo@fedora-17-amd64.(none)>
@@ -102,12 +108,15 @@ Brandon Thetford <brandon@dodecatec.com> <dodexahedron@users.noreply.github.com>
 buzzingwires <buzzingwires@outlook.com> <131118055+buzzingwires@users.noreply.github.com>
 Cedric Maunoury <cedric.maunoury@gmail.com> <38213715+cedricmaunoury@users.noreply.github.com>
 Charles Suh <charles.suh@gmail.com> <charlessuh@users.noreply.github.com>
+Chris Peredun <chris.peredun@ixsystems.com> <126915832+chrisperedun@users.noreply.github.com>
 Dacian Reece-Stremtan <dacianstremtan@gmail.com> <35844628+dacianstremtan@users.noreply.github.com>
 Damian Szuberski <szuberskidamian@gmail.com> <30863496+szubersk@users.noreply.github.com>
 Daniel Hiepler <d-git@coderdu.de> <32984777+heeplr@users.noreply.github.com>
 Daniel Kobras <d.kobras@science-computing.de> <sckobras@users.noreply.github.com>
 Daniel Reichelt <hacking@nachtgeist.net> <nachtgeist@users.noreply.github.com>
 David Quigley <david.quigley@intel.com> <dpquigl@users.noreply.github.com>
+Dennis R. Friedrichsen <dennis.r.friedrichsen@gmail.com> <31087738+dennisfriedrichsen@users.noreply.github.com>
+Dex Wood <slash2314@gmail.com> <slash2314@users.noreply.github.com>
 DHE <git@dehacked.net> <DeHackEd@users.noreply.github.com>
 Dmitri John Ledkov <dimitri.ledkov@canonical.com> <19779+xnox@users.noreply.github.com>
 Dries Michiels <driesm.michiels@gmail.com> <32487486+driesmp@users.noreply.github.com>
@@ -128,6 +137,7 @@ Harry Mallon <hjmallon@gmail.com> <1816667+hjmallon@users.noreply.github.com>
 Hiếu Lê <leorize+oss@disroot.org> <alaviss@users.noreply.github.com>
 Jake Howard <git@theorangeone.net> <RealOrangeOne@users.noreply.github.com>
 James Cowgill <james.cowgill@mips.com> <jcowgill@users.noreply.github.com>
+Jaron Kent-Dobias <jaron@kent-dobias.com> <kentdobias@users.noreply.github.com>
 Jason King <jason.king@joyent.com> <jasonbking@users.noreply.github.com>
 Jeff Dike <jdike@akamai.com> <52420226+jdike@users.noreply.github.com>
 Jitendra Patidar <jitendra.patidar@nutanix.com> <53164267+jsai20@users.noreply.github.com>
@@ -137,7 +147,9 @@ John L. Hammond <john.hammond@intel.com> <35266395+jhammond-intel@users.noreply.
 John-Mark Gurney <jmg@funkthat.com> <jmgurney@users.noreply.github.com>
 John Ramsden <johnramsden@riseup.net> <johnramsden@users.noreply.github.com>
 Jonathon Fernyhough <jonathon@m2x.dev> <559369+jonathonf@users.noreply.github.com>
+Jose Luis Duran <jlduran@gmail.com> <jlduran@users.noreply.github.com>
 Justin Hibbits <chmeeedalf@gmail.com> <chmeeedalf@users.noreply.github.com>
+Kevin Greene <kevin.greene@delphix.com> <104801862+kxgreene@users.noreply.github.com>
 Kevin Jin <lostking2008@hotmail.com> <33590050+jxdking@users.noreply.github.com>
 Kevin P. Fleming <kevin@km6g.us> <kpfleming@users.noreply.github.com>
 Krzysztof Piecuch <piecuch@kpiecuch.pl> <3964215+pikrzysztof@users.noreply.github.com>
@@ -148,9 +160,11 @@ Lorenz Hüdepohl <dev@stellardeath.org> <lhuedepohl@users.noreply.github.com>
 Luís Henriques <henrix@camandro.org> <73643340+lumigch@users.noreply.github.com>
 Marcin Skarbek <git@skarbek.name> <mskarbek@users.noreply.github.com>
 Matt Fiddaman <github@m.fiddaman.uk> <81489167+matt-fidd@users.noreply.github.com>
+Maxim Filimonov <che@bein.link> <part1zano@users.noreply.github.com>
 Max Zettlmeißl <max@zettlmeissl.de> <6818198+maxz@users.noreply.github.com>
 Michael Niewöhner <foss@mniewoehner.de> <c0d3z3r0@users.noreply.github.com>
 Michael Zhivich <mzhivich@akamai.com> <33133421+mzhivich@users.noreply.github.com>
+MigeljanImeri <ImeriMigel@gmail.com> <78048439+MigeljanImeri@users.noreply.github.com>
 Mo Zhou <cdluminate@gmail.com> <5723047+cdluminate@users.noreply.github.com>
 Nick Mattis <nickm970@gmail.com> <nmattis@users.noreply.github.com>
 omni <omni+vagant@hack.org> <79493359+omnivagant@users.noreply.github.com>
@@ -164,6 +178,7 @@ Ping Huang <huangping@smartx.com> <101400146+hpingfs@users.noreply.github.com>
 Piotr P. Stefaniak <pstef@freebsd.org> <pstef@users.noreply.github.com>
 Richard Allen <belperite@gmail.com> <33836503+belperite@users.noreply.github.com>
 Rich Ercolani <rincebrain@gmail.com> <214141+rincebrain@users.noreply.github.com>
+Rick Macklem <rmacklem@uoguelph.ca> <64620010+rmacklem@users.noreply.github.com>
 Rob Wing <rob.wing@klarasystems.com> <98866084+rob-wing@users.noreply.github.com>
 Roman Strashkin <roman.strashkin@nexenta.com> <Ramzec@users.noreply.github.com>
 Ryan Hirasaki <ryanhirasaki@gmail.com> <4690732+RyanHir@users.noreply.github.com>
@@ -174,6 +189,8 @@ Scott Colby <scott@scolby.com> <scolby33@users.noreply.github.com>
 Sean Eric Fagan <kithrup@mac.com> <kithrup@users.noreply.github.com>
 Spencer Kinny <spencerkinny1995@gmail.com> <30333052+Spencer-Kinny@users.noreply.github.com>
 Srikanth N S <srikanth.nagasubbaraoseetharaman@hpe.com> <75025422+nssrikanth@users.noreply.github.com>
+Stefan Lendl <s.lendl@proxmox.com> <1321542+stfl@users.noreply.github.com>
+Thomas Bertschinger <bertschinger@lanl.gov> <101425190+bertschinger@users.noreply.github.com>
 Thomas Geppert <geppi@digitx.de> <geppi@users.noreply.github.com>
 Tim Crawford <tcrawford@datto.com> <crawfxrd@users.noreply.github.com>
 Tom Matthews <tom@axiom-partners.com> <tomtastic@users.noreply.github.com>
@@ -181,6 +198,7 @@ Tony Perkins <tperkins@datto.com> <62951051+tony-zfs@users.noreply.github.com>
 Torsten Wörtwein <twoertwein@gmail.com> <twoertwein@users.noreply.github.com>
 Tulsi Jain <tulsi.jain@delphix.com> <TulsiJain@users.noreply.github.com>
 Václav Skála <skala@vshosting.cz> <33496485+vaclavskala@users.noreply.github.com>
+Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com> <88050553+vaibhav-delphix@users.noreply.github.com>
 Violet Purcell <vimproved@inventati.org> <66446404+vimproved@users.noreply.github.com>
 Vipin Kumar Verma <vipin.verma@hpe.com> <75025470+vermavipinkumar@users.noreply.github.com>
 Wolfgang Bumiller <w.bumiller@proxmox.com> <Blub@users.noreply.github.com>
diff --git a/sys/contrib/openzfs/AUTHORS b/sys/contrib/openzfs/AUTHORS
index be1efb87b34c..d7d55f42d2e7 100644
--- a/sys/contrib/openzfs/AUTHORS
+++ b/sys/contrib/openzfs/AUTHORS
@@ -88,9 +88,11 @@ CONTRIBUTORS:
     Bassu <bassu@phi9.com>
     Ben Allen <bsallen@alcf.anl.gov>
     Ben Cordero <bencord0@condi.me>
+    Benda Xu <orv@debian.org>
     Benedikt Neuffer <github@itfriend.de>
     Benjamin Albrecht <git@albrecht.io>
     Benjamin Gentil <benjgentil.pro@gmail.com>
+    Benjamin Sherman <benjamin@holyarmy.org>
     Ben McGough <bmcgough@fredhutch.org>
     Ben Rubson <ben.rubson@gmail.com>
     Ben Wolsieffer <benwolsieffer@gmail.com>
@@ -111,6 +113,7 @@ CONTRIBUTORS:
     bzzz77 <bzzz.tomas@gmail.com>
     cable2999 <cable2999@users.noreply.github.com>
     Caleb James DeLisle <calebdelisle@lavabit.com>
+    Cameron Harr <harr1@llnl.gov>
     Cao Xuewen <cao.xuewen@zte.com.cn>
     Carlo Landmeter <clandmeter@gmail.com>
     Carlos Alberto Lopez Perez <clopez@igalia.com>
@@ -120,12 +123,15 @@ CONTRIBUTORS:
     Chen Can <chen.can2@zte.com.cn>
     Chengfei Zhu <chengfeix.zhu@intel.com>
     Chen Haiquan <oc@yunify.com>
+    ChenHao Lu <18302010006@fudan.edu.cn>
     Chip Parker <aparker@enthought.com>
     Chris Burroughs <chris.burroughs@gmail.com>
+    Chris Davidson <christopher.davidson@gmail.com>
     Chris Dunlap <cdunlap@llnl.gov>
     Chris Dunlop <chris@onthe.net.au>
     Chris Lindee <chris.lindee+github@gmail.com>
     Chris McDonough <chrism@plope.com>
+    Chris Peredun <chris.peredun@ixsystems.com>
     Chris Siden <chris.siden@delphix.com>
     Chris Siebenmann <cks.github@cs.toronto.edu>
     Christer Ekholm <che@chrekh.se>
@@ -144,6 +150,7 @@ CONTRIBUTORS:
     Clint Armstrong <clint@clintarmstrong.net>
     Coleman Kane <ckane@colemankane.org>
     Colin Ian King <colin.king@canonical.com>
+    Colin Percival <cperciva@tarsnap.com>
     Colm Buckley <colm@tuatha.org>
     Crag Wang <crag0715@gmail.com>
     Craig Loomis <cloomis@astro.princeton.edu>
@@ -156,6 +163,7 @@ CONTRIBUTORS:
     Damiano Albani <damiano.albani@gmail.com>
     Damian Szuberski <szuberskidamian@gmail.com>
     Damian Wojsław <damian@wojslaw.pl>
+    Daniel Berlin <dberlin@dberlin.org>
     Daniel Hiepler <d-git@coderdu.de>
     Daniel Hoffman <dj.hoffman@delphix.com>
     Daniel Kobras <d.kobras@science-computing.de>
@@ -176,8 +184,10 @@ CONTRIBUTORS:
     David Quigley <david.quigley@intel.com>
     Debabrata Banerjee <dbanerje@akamai.com>
     D. Ebdrup <debdrup@freebsd.org>
+    Dennis R. Friedrichsen <dennis.r.friedrichsen@gmail.com>
     Denys Rtveliashvili <denys@rtveliashvili.name>
     Derek Dai <daiderek@gmail.com>
+    Dex Wood <slash2314@gmail.com>
     DHE <git@dehacked.net>
     Didier Roche <didrocks@ubuntu.com>
     Dimitri John Ledkov <xnox@ubuntu.com>
@@ -235,9 +245,11 @@ CONTRIBUTORS:
     Gionatan Danti <g.danti@assyoma.it>
     Giuseppe Di Natale <guss80@gmail.com>
     Glenn Washburn <development@efficientek.com>
+    gofaster <felix.gofaster@gmail.com>
     Gordan Bobic <gordan@redsleeve.org>
     Gordon Bergling <gbergling@googlemail.com>
     Gordon Ross <gwr@nexenta.com>
+    Gordon Tetlow <gordon@freebsd.org>
     Graham Christensen <graham@grahamc.com>
     Graham Perrin <grahamperrin@gmail.com>
     Gregor Kopka <gregor@kopka.net>
@@ -265,6 +277,7 @@ CONTRIBUTORS:
     Igor Kozhukhov <ikozhukhov@gmail.com>
     Igor Lvovsky <ilvovsky@gmail.com>
     ilbsmart <wgqimut@gmail.com>
+    Ilkka Sovanto <github@ilkka.kapsi.fi>
     illiliti <illiliti@protonmail.com>
     ilovezfs <ilovezfs@icloud.com>
     InsanePrawn <Insane.Prawny@gmail.com>
@@ -280,9 +293,11 @@ CONTRIBUTORS:
     Jan Engelhardt <jengelh@inai.de>
     Jan Kryl <jan.kryl@nexenta.com>
     Jan Sanislo <oystr@cs.washington.edu>
+    Jaron Kent-Dobias <jaron@kent-dobias.com>
     Jason Cohen <jwittlincohen@gmail.com>
     Jason Harmening <jason.harmening@gmail.com>
     Jason King <jason.brian.king@gmail.com>
+    Jason Lee <jasonlee@lanl.gov>
     Jason Zaman <jasonzaman@gmail.com>
     Javen Wu <wu.javen@gmail.com>
     Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
@@ -313,6 +328,7 @@ CONTRIBUTORS:
     Jonathon Fernyhough <jonathon@m2x.dev>
     Jorgen Lundman <lundman@lundman.net>
     Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
+    Jose Luis Duran <jlduran@gmail.com>
     Josh Soref <jsoref@users.noreply.github.com>
     Joshua M. Clulow <josh@sysmgr.org>
     José Luis Salvador Rufo <salvador.joseluis@gmail.com>
@@ -336,8 +352,10 @@ CONTRIBUTORS:
     Kash Pande <kash@tripleback.net>
     Kay Pedersen <christianpe96@gmail.com>
     Keith M Wesolowski <wesolows@foobazco.org>
+    Kent Ross <k@mad.cash>
     KernelOfTruth <kerneloftruth@gmail.com>
     Kevin Bowling <kevin.bowling@kev009.com>
+    Kevin Greene <kevin.greene@delphix.com>
     Kevin Jin <lostking2008@hotmail.com>
     Kevin P. Fleming <kevin@km6g.us>
     Kevin Tanguy <kevin.tanguy@ovh.net>
@@ -389,6 +407,7 @@ CONTRIBUTORS:
     Mark Shellenbaum <Mark.Shellenbaum@Oracle.COM>
     marku89 <mar42@kola.li>
     Mark Wright <markwright@internode.on.net>
+    Mart Frauenlob <allkind@fastest.cc>
     Martin Matuska <mm@FreeBSD.org>
     Martin Rüegg <martin.rueegg@metaworx.ch>
     Massimo Maggi <me@massimo-maggi.eu>
@@ -405,6 +424,7 @@ CONTRIBUTORS:
     Matus Kral <matuskral@me.com>
     Mauricio Faria de Oliveira <mfo@canonical.com>
     Max Grossman <max.grossman@delphix.com>
+    Maxim Filimonov <che@bein.link>
     Maximilian Mehnert <maximilian.mehnert@gmx.de>
     Max Zettlmeißl <max@zettlmeissl.de>
     Md Islam <mdnahian@outlook.com>
@@ -417,6 +437,7 @@ CONTRIBUTORS:
     Michael Niewöhner <foss@mniewoehner.de>
     Michael Zhivich <mzhivich@akamai.com>
     Michal Vasilek <michal@vasilek.cz>
+    MigeljanImeri <ImeriMigel@gmail.com>
     Mike Gerdts <mike.gerdts@joyent.com>
     Mike Harsch <mike@harschsystems.com>
     Mike Leddy <mike.leddy@gmail.com>
@@ -448,6 +469,7 @@ CONTRIBUTORS:
     Olaf Faaland <faaland1@llnl.gov>
     Oleg Drokin <green@linuxhacker.ru>
     Oleg Stepura <oleg@stepura.com>
+    Olivier Certner <olce.freebsd@certner.fr>
     Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
     omni <omni+vagant@hack.org>
     Orivej Desh <orivej@gmx.fr>
@@ -479,6 +501,7 @@ CONTRIBUTORS:
     Prasad Joshi <prasadjoshi124@gmail.com>
     privb0x23 <privb0x23@users.noreply.github.com>
     P.SCH <p88@yahoo.com>
+    Quartz <yyhran@163.com>
     Quentin Zdanis <zdanisq@gmail.com>
     Rafael Kitover <rkitover@gmail.com>
     RageLtMan <sempervictus@users.noreply.github.com>
@@ -491,11 +514,15 @@ CONTRIBUTORS:
     Riccardo Schirone <rschirone91@gmail.com>
     Richard Allen <belperite@gmail.com>
     Richard Elling <Richard.Elling@RichardElling.com>
+    Richard Kojedzinszky <richard@kojedz.in>
     Richard Laager <rlaager@wiktel.com>
     Richard Lowe <richlowe@richlowe.net>
     Richard Sharpe <rsharpe@samba.org>
     Richard Yao <ryao@gentoo.org>
     Rich Ercolani <rincebrain@gmail.com>
+    Rick Macklem <rmacklem@uoguelph.ca>
+    rilysh <nightquick@proton.me>
+    Robert Evans <evansr@google.com>
     Robert Novak <sailnfool@gmail.com>
     Roberto Ricci <ricci@disroot.org>
     Rob Norris <robn@despairlabs.com>
@@ -509,7 +536,9 @@ CONTRIBUTORS:
     Ryan Lahfa <masterancpp@gmail.com>
     Ryan Libby <rlibby@FreeBSD.org>
     Ryan Moeller <freqlabs@FreeBSD.org>
+    Sam Atkinson <samatk@amazon.com>
     Sam Hathaway <github.com@munkynet.org>
+    Sam James <sam@gentoo.org>
     Sam Lunt <samuel.j.lunt@gmail.com>
     Samuel VERSCHELDE <stormi-github@ylix.fr>
     Samuel Wycliffe <samuelwycliffe@gmail.com>
@@ -530,6 +559,8 @@ CONTRIBUTORS:
     Shaan Nobee <sniper111@gmail.com>
     Shampavman <sham.pavman@nexenta.com>
     Shaun Tancheff <shaun@aeonazure.com>
+    Shawn Bayern <sbayern@law.fsu.edu>
+    Shengqi Chen <harry-chen@outlook.com>
     Shen Yan <shenyanxxxy@qq.com>
     Simon Guest <simon.guest@tesujimath.org>
     Simon Klinkert <simon.klinkert@gmail.com>
@@ -537,6 +568,7 @@ CONTRIBUTORS:
     Spencer Kinny <spencerkinny1995@gmail.com>
     Srikanth N S <srikanth.nagasubbaraoseetharaman@hpe.com>
     Stanislav Seletskiy <s.seletskiy@gmail.com>
+    Stefan Lendl <s.lendl@proxmox.com>
     Steffen Müthing <steffen.muething@iwr.uni-heidelberg.de>
     Stephen Blinick <stephen.blinick@delphix.com>
     sterlingjensen <sterlingjensen@users.noreply.github.com>
@@ -557,6 +589,7 @@ CONTRIBUTORS:
     Teodor Spæren <teodor_spaeren@riseup.net>
     TerraTech <TerraTech@users.noreply.github.com>
     Thijs Cramer <thijs.cramer@gmail.com>
+    Thomas Bertschinger <bertschinger@lanl.gov>
     Thomas Geppert <geppi@digitx.de>
     Thomas Lamprecht <guggentom@hotmail.de>
     Till Maas <opensource@till.name>
@@ -586,6 +619,7 @@ CONTRIBUTORS:
     Turbo Fredriksson <turbo@bayour.com>
     Tyler J. Stachecki <stachecki.tyler@gmail.com>
     Umer Saleem <usaleem@ixsystems.com>
+    Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com>
     Valmiky Arquissandas <kayvlim@gmail.com>
     Val Packett <val@packett.cool>
     Vince van Oosten <techhazard@codeforyouand.me>
@@ -614,6 +648,7 @@ CONTRIBUTORS:
     yuina822 <ayuichi@club.kyutech.ac.jp>
     YunQiang Su <syq@debian.org>
     Yuri Pankov <yuri.pankov@gmail.com>
+    Yuxin Wang <yuxinwang9999@gmail.com>
     Yuxuan Shui <yshuiv7@gmail.com>
     Zachary Bedell <zac@thebedells.org>
     Zach Dykstra <dykstra.zachary@gmail.com>
diff --git a/sys/contrib/openzfs/META b/sys/contrib/openzfs/META
index d64414e32225..383fa37fd42a 100644
--- a/sys/contrib/openzfs/META
+++ b/sys/contrib/openzfs/META
@@ -1,10 +1,10 @@
 Meta:          1
 Name:          zfs
 Branch:        1.0
-Version:       2.2.3
+Version:       2.2.4
 Release:       1
 Release-Tags:  relext
 License:       CDDL
 Author:        OpenZFS
-Linux-Maximum: 6.7
+Linux-Maximum: 6.8
 Linux-Minimum: 3.10
diff --git a/sys/contrib/openzfs/cmd/arc_summary b/sys/contrib/openzfs/cmd/arc_summary
index 9c69ec4f8ccc..100fb1987a8b 100755
--- a/sys/contrib/openzfs/cmd/arc_summary
+++ b/sys/contrib/openzfs/cmd/arc_summary
@@ -793,18 +793,27 @@ def section_dmu(kstats_dict):
 
     zfetch_stats = isolate_section('zfetchstats', kstats_dict)
 
-    zfetch_access_total = int(zfetch_stats['hits'])+int(zfetch_stats['misses'])
+    zfetch_access_total = int(zfetch_stats['hits']) +\
+        int(zfetch_stats['future']) + int(zfetch_stats['stride']) +\
+        int(zfetch_stats['past']) + int(zfetch_stats['misses'])
 
     prt_1('DMU predictive prefetcher calls:', f_hits(zfetch_access_total))
     prt_i2('Stream hits:',
            f_perc(zfetch_stats['hits'], zfetch_access_total),
            f_hits(zfetch_stats['hits']))
+    future = int(zfetch_stats['future']) + int(zfetch_stats['stride'])
+    prt_i2('Hits ahead of stream:', f_perc(future, zfetch_access_total),
+           f_hits(future))
+    prt_i2('Hits behind stream:',
+           f_perc(zfetch_stats['past'], zfetch_access_total),
+           f_hits(zfetch_stats['past']))
     prt_i2('Stream misses:',
            f_perc(zfetch_stats['misses'], zfetch_access_total),
            f_hits(zfetch_stats['misses']))
     prt_i2('Streams limit reached:',
            f_perc(zfetch_stats['max_streams'], zfetch_stats['misses']),
            f_hits(zfetch_stats['max_streams']))
+    prt_i1('Stream strides:', f_hits(zfetch_stats['stride']))
     prt_i1('Prefetches issued', f_hits(zfetch_stats['io_issued']))
     print()
 
diff --git a/sys/contrib/openzfs/cmd/arcstat.in b/sys/contrib/openzfs/cmd/arcstat.in
index 8df1c62f7e86..c4f10a1d6d3b 100755
--- a/sys/contrib/openzfs/cmd/arcstat.in
+++ b/sys/contrib/openzfs/cmd/arcstat.in
@@ -157,6 +157,16 @@ cols = {
     "free":       [5, 1024, "ARC free memory"],
     "avail":      [5, 1024, "ARC available memory"],
     "waste":      [5, 1024, "Wasted memory due to round up to pagesize"],
+    "ztotal":     [6, 1000, "zfetch total prefetcher calls per second"],
+    "zhits":      [5, 1000, "zfetch stream hits per second"],
+    "zahead":     [6, 1000, "zfetch hits ahead of streams per second"],
+    "zpast":      [5, 1000, "zfetch hits behind streams per second"],
+    "zmisses":    [7, 1000, "zfetch stream misses per second"],
+    "zmax":       [4, 1000, "zfetch limit reached per second"],
+    "zfuture":    [7, 1000, "zfetch stream future per second"],
+    "zstride":    [7, 1000, "zfetch stream strides per second"],
+    "zissued":    [7, 1000, "zfetch prefetches issued per second"],
+    "zactive":    [7, 1000, "zfetch prefetches active per second"],
 }
 
 v = {}
@@ -164,6 +174,8 @@ hdr = ["time", "read", "ddread", "ddh%", "dmread", "dmh%", "pread", "ph%",
        "size", "c", "avail"]
 xhdr = ["time", "mfu", "mru", "mfug", "mrug", "unc", "eskip", "mtxmis",
         "dread", "pread", "read"]
+zhdr = ["time", "ztotal", "zhits", "zahead", "zpast", "zmisses", "zmax",
+        "zfuture", "zstride", "zissued", "zactive"]
 sint = 1               # Default interval is 1 second
 count = 1              # Default count is 1
 hdr_intr = 20          # Print header every 20 lines of output
@@ -188,6 +200,8 @@ if sys.platform.startswith('freebsd'):
 
         k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats')
              if ctl.type != sysctl.CTLTYPE_NODE]
+        k += [ctl for ctl in sysctl.filter('kstat.zfs.misc.zfetchstats')
+             if ctl.type != sysctl.CTLTYPE_NODE]
 
         if not k:
             sys.exit(1)
@@ -199,19 +213,28 @@ if sys.platform.startswith('freebsd'):
                 continue
 
             name, value = s.name, s.value
-            # Trims 'kstat.zfs.misc.arcstats' from the name
-            kstat[name[24:]] = int(value)
+
+            if "arcstats" in name:
+                # Trims 'kstat.zfs.misc.arcstats' from the name
+                kstat[name[24:]] = int(value)
+            else:
+                kstat["zfetch_" + name[27:]] = int(value)
 
 elif sys.platform.startswith('linux'):
     def kstat_update():
         global kstat
 
-        k = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')]
+        k1 = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')]
 
-        if not k:
+        k2 = ["zfetch_" + line.strip() for line in
+             open('/proc/spl/kstat/zfs/zfetchstats')]
+
+        if k1 is None or k2 is None:
             sys.exit(1)
 
-        del k[0:2]
+        del k1[0:2]
+        del k2[0:2]
+        k = k1 + k2
         kstat = {}
 
         for s in k:
@@ -239,6 +262,7 @@ def usage():
     sys.stderr.write("\t -v : List all possible field headers and definitions"
                      "\n")
     sys.stderr.write("\t -x : Print extended stats\n")
+    sys.stderr.write("\t -z : Print zfetch stats\n")
     sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n")
     sys.stderr.write("\t -o : Redirect output to the specified file\n")
     sys.stderr.write("\t -s : Override default field separator with custom "
@@ -357,6 +381,7 @@ def init():
     global count
     global hdr
     global xhdr
+    global zhdr
     global opfile
     global sep
     global out
@@ -368,15 +393,17 @@ def init():
     xflag = False
     hflag = False
     vflag = False
+    zflag = False
     i = 1
 
     try:
         opts, args = getopt.getopt(
             sys.argv[1:],
-            "axo:hvs:f:p",
+            "axzo:hvs:f:p",
             [
                 "all",
                 "extended",
+                "zfetch",
                 "outfile",
                 "help",
                 "verbose",
@@ -410,13 +437,15 @@ def init():
             i += 1
         if opt in ('-p', '--parsable'):
             pretty_print = False
+        if opt in ('-z', '--zfetch'):
+            zflag = True
         i += 1
 
     argv = sys.argv[i:]
     sint = int(argv[0]) if argv else sint
     count = int(argv[1]) if len(argv) > 1 else (0 if len(argv) > 0 else 1)
 
-    if hflag or (xflag and desired_cols):
+    if hflag or (xflag and zflag) or ((zflag or xflag) and desired_cols):
         usage()
 
     if vflag:
@@ -425,6 +454,9 @@ def init():
     if xflag:
         hdr = xhdr
 
+    if zflag:
+        hdr = zhdr
+
     update_hdr_intr()
 
     # check if L2ARC exists
@@ -569,6 +601,17 @@ def calculate():
     v["el2mru"] = d["evict_l2_eligible_mru"] // sint
     v["el2inel"] = d["evict_l2_ineligible"] // sint
     v["mtxmis"] = d["mutex_miss"] // sint
+    v["ztotal"] = (d["zfetch_hits"] + d["zfetch_future"] + d["zfetch_stride"] +
+                   d["zfetch_past"] + d["zfetch_misses"]) // sint
+    v["zhits"] = d["zfetch_hits"] // sint
+    v["zahead"] = (d["zfetch_future"] + d["zfetch_stride"]) // sint
+    v["zpast"] = d["zfetch_past"] // sint
+    v["zmisses"] = d["zfetch_misses"] // sint
+    v["zmax"] = d["zfetch_max_streams"] // sint
+    v["zfuture"] = d["zfetch_future"] // sint
+    v["zstride"] = d["zfetch_stride"] // sint
+    v["zissued"] = d["zfetch_io_issued"] // sint
+    v["zactive"] = d["zfetch_io_active"] // sint
 
     if l2exist:
         v["l2hits"] = d["l2_hits"] // sint
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c
index 4a6cfbf8c05c..fe43e2ab971e 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c
@@ -22,6 +22,7 @@
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  *
  * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2023, Klara Inc.
  */
 
 /*
@@ -231,28 +232,6 @@ fmd_prop_get_int32(fmd_hdl_t *hdl, const char *name)
 	if (strcmp(name, "spare_on_remove") == 0)
 		return (1);
 
-	if (strcmp(name, "io_N") == 0 || strcmp(name, "checksum_N") == 0)
-		return (10);	/* N = 10 events */
-
-	return (0);
-}
-
-int64_t
-fmd_prop_get_int64(fmd_hdl_t *hdl, const char *name)
-{
-	(void) hdl;
-
-	/*
-	 * These can be looked up in mp->modinfo->fmdi_props
-	 * For now we just hard code for phase 2. In the
-	 * future, there can be a ZED based override.
-	 */
-	if (strcmp(name, "remove_timeout") == 0)
-		return (15ULL * 1000ULL * 1000ULL * 1000ULL);	/* 15 sec */
-
-	if (strcmp(name, "io_T") == 0 || strcmp(name, "checksum_T") == 0)
-		return (1000ULL * 1000ULL * 1000ULL * 600ULL);	/* 10 min */
-
 	return (0);
 }
 
@@ -535,20 +514,31 @@ fmd_serd_exists(fmd_hdl_t *hdl, const char *name)
 	return (fmd_serd_eng_lookup(&mp->mod_serds, name) != NULL);
 }
 
-void
-fmd_serd_reset(fmd_hdl_t *hdl, const char *name)
+int
+fmd_serd_active(fmd_hdl_t *hdl, const char *name)
 {
 	fmd_module_t *mp = (fmd_module_t *)hdl;
 	fmd_serd_eng_t *sgp;
 
 	if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
 		zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name);
-		return;
+		return (0);
 	}
+	return (fmd_serd_eng_fired(sgp) || !fmd_serd_eng_empty(sgp));
+}
 
-	fmd_serd_eng_reset(sgp);
+void
+fmd_serd_reset(fmd_hdl_t *hdl, const char *name)
+{
+	fmd_module_t *mp = (fmd_module_t *)hdl;
+	fmd_serd_eng_t *sgp;
 
-	fmd_hdl_debug(hdl, "serd_reset %s", name);
+	if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
+		zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name);
+	} else {
+		fmd_serd_eng_reset(sgp);
+		fmd_hdl_debug(hdl, "serd_reset %s", name);
+	}
 }
 
 int
@@ -556,16 +546,21 @@ fmd_serd_record(fmd_hdl_t *hdl, const char *name, fmd_event_t *ep)
 {
 	fmd_module_t *mp = (fmd_module_t *)hdl;
 	fmd_serd_eng_t *sgp;
-	int err;
 
 	if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
 		zed_log_msg(LOG_ERR, "failed to add record to SERD engine '%s'",
 		    name);
 		return (0);
 	}
-	err = fmd_serd_eng_record(sgp, ep->ev_hrt);
+	return (fmd_serd_eng_record(sgp, ep->ev_hrt));
+}
+
+void
+fmd_serd_gc(fmd_hdl_t *hdl)
+{
+	fmd_module_t *mp = (fmd_module_t *)hdl;
 
-	return (err);
+	fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL);
 }
 
 /* FMD Timers */
@@ -579,7 +574,7 @@ _timer_notify(union sigval sv)
 	const fmd_hdl_ops_t *ops = mp->mod_info->fmdi_ops;
 	struct itimerspec its;
 
-	fmd_hdl_debug(hdl, "timer fired (%p)", ftp->ft_tid);
+	fmd_hdl_debug(hdl, "%s timer fired (%p)", mp->mod_name, ftp->ft_tid);
 
 	/* disarm the timer */
 	memset(&its, 0, sizeof (struct itimerspec));
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h
index b940d0d395ec..8471feecf33f 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h
@@ -151,7 +151,6 @@ extern void fmd_hdl_vdebug(fmd_hdl_t *, const char *, va_list);
 extern void fmd_hdl_debug(fmd_hdl_t *, const char *, ...);
 
 extern int32_t fmd_prop_get_int32(fmd_hdl_t *, const char *);
-extern int64_t fmd_prop_get_int64(fmd_hdl_t *, const char *);
 
 #define	FMD_STAT_NOALLOC	0x0	/* fmd should use caller's memory */
 #define	FMD_STAT_ALLOC		0x1	/* fmd should allocate stats memory */
@@ -195,10 +194,12 @@ extern size_t fmd_buf_size(fmd_hdl_t *, fmd_case_t *, const char *);
 extern void fmd_serd_create(fmd_hdl_t *, const char *, uint_t, hrtime_t);
 extern void fmd_serd_destroy(fmd_hdl_t *, const char *);
 extern int fmd_serd_exists(fmd_hdl_t *, const char *);
+extern int fmd_serd_active(fmd_hdl_t *, const char *);
 extern void fmd_serd_reset(fmd_hdl_t *, const char *);
 extern int fmd_serd_record(fmd_hdl_t *, const char *, fmd_event_t *);
 extern int fmd_serd_fired(fmd_hdl_t *, const char *);
 extern int fmd_serd_empty(fmd_hdl_t *, const char *);
+extern void fmd_serd_gc(fmd_hdl_t *);
 
 extern id_t fmd_timer_install(fmd_hdl_t *, void *, fmd_event_t *, hrtime_t);
 extern void fmd_timer_remove(fmd_hdl_t *, id_t);
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c
index 0bb2c535f094..f942e62b3f48 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c
@@ -310,8 +310,9 @@ fmd_serd_eng_reset(fmd_serd_eng_t *sgp)
 }
 
 void
-fmd_serd_eng_gc(fmd_serd_eng_t *sgp)
+fmd_serd_eng_gc(fmd_serd_eng_t *sgp, void *arg)
 {
+	(void) arg;
 	fmd_serd_elem_t *sep, *nep;
 	hrtime_t hrt;
 
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h
index 25b6888e61f2..80ff9a3b25b8 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h
@@ -77,7 +77,7 @@ extern int fmd_serd_eng_fired(fmd_serd_eng_t *);
 extern int fmd_serd_eng_empty(fmd_serd_eng_t *);
 
 extern void fmd_serd_eng_reset(fmd_serd_eng_t *);
-extern void fmd_serd_eng_gc(fmd_serd_eng_t *);
+extern void fmd_serd_eng_gc(fmd_serd_eng_t *, void *);
 
 #ifdef	__cplusplus
 }
diff --git a/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c b/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c
index f6ba334a3ba3..e0ad00800add 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c
+++ b/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c
@@ -23,6 +23,7 @@
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2023, Klara Inc.
  */
 
 #include <stddef.h>
@@ -47,11 +48,16 @@
 #define	DEFAULT_CHECKSUM_T	600	/* seconds */
 #define	DEFAULT_IO_N		10	/* events */
 #define	DEFAULT_IO_T		600	/* seconds */
+#define	DEFAULT_SLOW_IO_N	10	/* events */
+#define	DEFAULT_SLOW_IO_T	30	/* seconds */
+
+#define	CASE_GC_TIMEOUT_SECS	43200	/* 12 hours */
 
 /*
- * Our serd engines are named 'zfs_<pool_guid>_<vdev_guid>_{checksum,io}'.  This
- * #define reserves enough space for two 64-bit hex values plus the length of
- * the longest string.
+ * Our serd engines are named in the following format:
+ *     'zfs_<pool_guid>_<vdev_guid>_{checksum,io,slow_io}'
+ * This #define reserves enough space for two 64-bit hex values plus the
+ * length of the longest string.
  */
 #define	MAX_SERDLEN	(16 * 2 + sizeof ("zfs___checksum"))
 
@@ -68,6 +74,7 @@ typedef struct zfs_case_data {
 	int		zc_pool_state;
 	char		zc_serd_checksum[MAX_SERDLEN];
 	char		zc_serd_io[MAX_SERDLEN];
+	char		zc_serd_slow_io[MAX_SERDLEN];
 	int		zc_has_remove_timer;
 } zfs_case_data_t;
 
@@ -114,7 +121,8 @@ zfs_de_stats_t zfs_stats = {
 	{ "resource_drops", FMD_TYPE_UINT64, "resource related ereports" }
 };
 
-static hrtime_t zfs_remove_timeout;
+/* wait 15 seconds after a removal */
+static hrtime_t zfs_remove_timeout = SEC2NSEC(15);
 
 uu_list_pool_t *zfs_case_pool;
*** 11838 LINES SKIPPED ***