]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Parallel pool import
authorGeorge Wilson <george.wilson@delphix.com>
Mon, 22 Apr 2024 16:42:38 +0000 (12:42 -0400)
committerGitHub <noreply@github.com>
Mon, 22 Apr 2024 16:42:38 +0000 (09:42 -0700)
commitc183d164aa11e61dfe1f34907c1a029d75162f1d
tree2bab94bd56530faaaf5f1aaad5c6ac8467de99f2
parentf4f156157de3f61e55db0429b10c63d02226e115
Parallel pool import

This commit allow spa_load() to drop the spa_namespace_lock so
that imports can happen concurrently. Prior to dropping the
spa_namespace_lock, the import logic will set the spa_load_thread
value to track the thread which is doing the import.

Consumers of spa_lookup() retain the same behavior by blocking
when either a thread is holding the spa_namespace_lock or the
spa_load_thread value is set. This will ensure that critical
concurrent operations cannot take place while a pool is being
imported.

The zpool command is also enhanced to provide multi-threaded support
when invoking zpool import -a.

Lastly, zinject provides a mechanism to insert artificial delays
when importing a pool and new zfs tests are added to verify parallel
import functionality.

Contributions-by: Don Brady <don.brady@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #16093
19 files changed:
cmd/zinject/zinject.c
cmd/zpool/zpool_main.c
include/libzutil.h
include/sys/spa.h
include/sys/spa_impl.h
include/sys/zfs_ioctl.h
include/sys/zio.h
man/man8/zinject.8
module/zfs/spa.c
module/zfs/spa_misc.c
module/zfs/vdev_initialize.c
module/zfs/vdev_rebuild.c
module/zfs/vdev_trim.c
module/zfs/zio_inject.c
tests/runfiles/common.run
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_admin.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_neg.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_pos.ksh [new file with mode: 0755]