Include class name into struct metaslab_class

With increasing number of metaslab classes it can be helpful for
debugging to know what we are looking at.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #17409
This commit is contained in:
Alexander Motin
2025-06-03 11:12:59 -04:00
committed by GitHub
parent 108562344c
commit 68817d28c5
5 changed files with 35 additions and 17 deletions
+7 -5
View File
@@ -4221,7 +4221,7 @@ again:
zfs_dbgmsg("%s[%llu]: %s class spilling, req size %llu, "
"%llu allocated of %llu",
spa_name(spa), (u_longlong_t)zio->io_txg,
mc == spa_dedup_class(spa) ? "dedup" : "special",
metaslab_class_get_name(mc),
(u_longlong_t)zio->io_size,
(u_longlong_t)metaslab_class_get_alloc(mc),
(u_longlong_t)metaslab_class_get_space(mc));
@@ -4245,10 +4245,12 @@ again:
}
if (zfs_flags & ZFS_DEBUG_METASLAB_ALLOC) {
zfs_dbgmsg("%s: metaslab allocation failure, "
"trying fallback: zio %px, size %llu, error %d",
spa_name(spa), zio, (u_longlong_t)zio->io_size,
error);
zfs_dbgmsg("%s: metaslab allocation failure in %s "
"class, trying fallback to %s class: zio %px, "
"size %llu, error %d", spa_name(spa),
metaslab_class_get_name(mc),
metaslab_class_get_name(newmc),
zio, (u_longlong_t)zio->io_size, error);
}
zio->io_metaslab_class = mc = newmc;
ZIOSTAT_BUMP(ziostat_alloc_class_fallbacks);