Remove mg_allocators (#17192)

Previous code allowed each metaslab group to have different number
of allocators.  But in practice it worked only for embedded SLOGs,
relying on a number of conditions and creating a significant mine
field if any of those change.  I just stepped on one myself.

This change makes all groups to have spa_alloc_count allocators.
It may cost us extra 192 bytes of memory per normal top-level vdev
on large systems, but I find it a small price for cleaner and more
reliable code.

Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Fixes #17188
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
This commit is contained in:
Alexander Motin
2025-03-28 16:11:10 -04:00
committed by GitHub
parent 30cc2331f4
commit 5b29e70ae1
4 changed files with 16 additions and 17 deletions
+2 -3
View File
@@ -1490,12 +1490,11 @@ vdev_metaslab_group_create(vdev_t *vd)
mc = spa_normal_class(spa);
}
vd->vdev_mg = metaslab_group_create(mc, vd,
spa->spa_alloc_count);
vd->vdev_mg = metaslab_group_create(mc, vd);
if (!vd->vdev_islog) {
vd->vdev_log_mg = metaslab_group_create(
spa_embedded_log_class(spa), vd, 1);
spa_embedded_log_class(spa), vd);
}
/*