Introduce names for ZTHRs

When debugging issues or generally analyzing the runtime of
a system it would be nice to be able to tell the different
ZTHRs running by name rather than having to analyze their
stack.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Co-authored-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #10630
This commit is contained in:
Serapheim Dimitropoulos
2020-07-29 09:43:33 -07:00
committed by GitHub
parent 5678d3f593
commit 843e9ca2e1
8 changed files with 43 additions and 23 deletions
+8 -4
View File
@@ -2548,7 +2548,8 @@ static void
spa_start_livelist_destroy_thread(spa_t *spa)
{
ASSERT3P(spa->spa_livelist_delete_zthr, ==, NULL);
spa->spa_livelist_delete_zthr = zthr_create(
spa->spa_livelist_delete_zthr =
zthr_create("z_livelist_destroy",
spa_livelist_delete_cb_check, spa_livelist_delete_cb, spa);
}
@@ -2755,8 +2756,10 @@ spa_start_livelist_condensing_thread(spa_t *spa)
spa->spa_to_condense.cancelled = B_FALSE;
ASSERT3P(spa->spa_livelist_condense_zthr, ==, NULL);
spa->spa_livelist_condense_zthr = zthr_create(
spa_livelist_condense_cb_check, spa_livelist_condense_cb, spa);
spa->spa_livelist_condense_zthr =
zthr_create("z_livelist_condense",
spa_livelist_condense_cb_check,
spa_livelist_condense_cb, spa);
}
static void
@@ -2772,7 +2775,8 @@ spa_spawn_aux_threads(spa_t *spa)
ASSERT3P(spa->spa_checkpoint_discard_zthr, ==, NULL);
spa->spa_checkpoint_discard_zthr =
zthr_create(spa_checkpoint_discard_thread_check,
zthr_create("z_checkpoint_discard",
spa_checkpoint_discard_thread_check,
spa_checkpoint_discard_thread, spa);
}