]> git.proxmox.com Git - mirror_zfs.git/commit
Add support for parallel pool exports
authorDon Brady <don.brady@klarasystems.com>
Thu, 2 May 2024 19:28:10 +0000 (19:28 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 14 May 2024 15:57:41 +0000 (08:57 -0700)
commit975a13259b87572c39d8467f1f4a31869d0abc84
tree446105254c7ece55b37e371f216b5a7e2e36cb75
parentabec7dcd30acfb195bca36334cec4fe82b082b1d
Add support for parallel pool exports

Changed spa_export_common() such that it no longer holds the
spa_namespace_lock for the entire duration and instead sets
spa_export_thread to indicate an import is in progress on the
spa.  This allows for an export to a diffent pool to proceed
in parallel while an export is still processing potentially
long operations like spa_unload_log_sm_flush_all().

Calls like spa_lookup() and spa_vdev_enter() that rely on
the spa_namespace_lock to serialize them against a concurrent
export, now wait for any in-progress export thread to complete
before proceeding.

The 'zpool import -a' sub-command also provides multi-threaded
support, using a thread pool to submit the exports in parallel.

Sponsored-By: Klara Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Don Brady <don.brady@klarasystems.com>
Closes #16153
12 files changed:
cmd/zpool/zpool_main.c
include/sys/spa_impl.h
module/zfs/arc.c
module/zfs/spa.c
module/zfs/spa_misc.c
module/zfs/vdev_initialize.c
module/zfs/vdev_rebuild.c
module/zfs/vdev_trim.c
tests/runfiles/common.run
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_parallel_admin.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_parallel_pos.ksh [new file with mode: 0755]