Remove pool io kstats (#12212)

This mostly reverts "3537 want pool io kstats" commit of 8 years ago.

From one side this code using pool-wide locks became pretty bad for
performance, creating significant lock contention in I/O pipeline.
From another, there are more efficient ways now to obtain detailed
statistics, while this statistics is illumos-specific and much less
usable on Linux and FreeBSD, reported only via procfs/sysctls.

This commit does not remove KSTAT_TYPE_IO implementation, that may
be removed later together with already unused KSTAT_TYPE_INTR and
KSTAT_TYPE_TIMER.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12212
This commit is contained in:
Alexander Motin
2021-06-10 11:27:33 -04:00
committed by GitHub
parent 860051f1d1
commit 371f88d96f
10 changed files with 0 additions and 276 deletions
-50
View File
@@ -548,54 +548,6 @@ spa_tx_assign_add_nsecs(spa_t *spa, uint64_t nsecs)
atomic_inc_64(&((kstat_named_t *)shk->priv)[idx].value.ui64);
}
/*
* ==========================================================================
* SPA IO History Routines
* ==========================================================================
*/
static int
spa_io_history_update(kstat_t *ksp, int rw)
{
if (rw == KSTAT_WRITE)
memset(ksp->ks_data, 0, ksp->ks_data_size);
return (0);
}
static void
spa_io_history_init(spa_t *spa)
{
spa_history_kstat_t *shk = &spa->spa_stats.io_history;
char *name;
kstat_t *ksp;
mutex_init(&shk->lock, NULL, MUTEX_DEFAULT, NULL);
name = kmem_asprintf("zfs/%s", spa_name(spa));
ksp = kstat_create(name, 0, "io", "disk", KSTAT_TYPE_IO, 1, 0);
shk->kstat = ksp;
if (ksp) {
ksp->ks_lock = &shk->lock;
ksp->ks_private = spa;
ksp->ks_update = spa_io_history_update;
kstat_install(ksp);
}
kmem_strfree(name);
}
static void
spa_io_history_destroy(spa_t *spa)
{
spa_history_kstat_t *shk = &spa->spa_stats.io_history;
if (shk->kstat)
kstat_delete(shk->kstat);
mutex_destroy(&shk->lock);
}
/*
* ==========================================================================
* SPA MMP History Routines
@@ -996,7 +948,6 @@ spa_stats_init(spa_t *spa)
spa_read_history_init(spa);
spa_txg_history_init(spa);
spa_tx_assign_init(spa);
spa_io_history_init(spa);
spa_mmp_history_init(spa);
spa_state_init(spa);
spa_iostats_init(spa);
@@ -1010,7 +961,6 @@ spa_stats_destroy(spa_t *spa)
spa_tx_assign_destroy(spa);
spa_txg_history_destroy(spa);
spa_read_history_destroy(spa);
spa_io_history_destroy(spa);
spa_mmp_history_destroy(spa);
}