aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev_rebuild.c
diff options
context:
space:
mode:
authorDon Brady <[email protected]>2024-05-02 19:28:10 +0000
committerBrian Behlendorf <[email protected]>2024-05-14 08:57:41 -0700
commit975a13259b87572c39d8467f1f4a31869d0abc84 (patch)
tree446105254c7ece55b37e371f216b5a7e2e36cb75 /module/zfs/vdev_rebuild.c
parentabec7dcd30acfb195bca36334cec4fe82b082b1d (diff)
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 <[email protected]> Reviewed-by: George Wilson <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #16153
Diffstat (limited to 'module/zfs/vdev_rebuild.c')
-rw-r--r--module/zfs/vdev_rebuild.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/vdev_rebuild.c b/module/zfs/vdev_rebuild.c
index 00ebd4c9f..8a8b02cab 100644
--- a/module/zfs/vdev_rebuild.c
+++ b/module/zfs/vdev_rebuild.c
@@ -1087,7 +1087,8 @@ vdev_rebuild_stop_wait(vdev_t *vd)
{
spa_t *spa = vd->vdev_spa;
- ASSERT(MUTEX_HELD(&spa_namespace_lock));
+ ASSERT(MUTEX_HELD(&spa_namespace_lock) ||
+ spa->spa_export_thread == curthread);
if (vd == spa->spa_root_vdev) {
for (uint64_t i = 0; i < vd->vdev_children; i++)