diff options
author | Trevor Bautista <[email protected]> | 2021-08-26 11:26:49 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-26 11:26:49 -0700 |
commit | 00888c08980578949155f45e2c23027e940405d6 (patch) | |
tree | 9b317bf355a2825767526a4f332bfbf4a10acb90 /module | |
parent | b0f3f393d135e0f69c28ef2ca11508a4a2559ee6 (diff) |
Extend zpool-iostat to account for ZIO_PRIORITY_REBUILD (#12319)
Previously, zpool-iostat did not display any data regarding rebuild I/Os
in either the latency/size histograms (-w/-l/-r) or the queue data (-q).
This fix essentially utilizes the existing infrastructure for tracking
rebuild queue data and displays this data in the proper places within
zpool-iostat's output.
Signed-off-by: Trevor Bautista <[email protected]>
Signed-off-by: Trevor Bautista <[email protected]>
Co-authored-by: Trevor Bautista <[email protected]>
Reviewed-by: Richard Elling <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/vdev.c | 9 | ||||
-rw-r--r-- | module/zfs/vdev_label.c | 18 |
2 files changed, 21 insertions, 6 deletions
diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 47a475135..2763bd8de 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -4583,13 +4583,10 @@ vdev_stat_update(zio_t *zio, uint64_t psize) * ZIO_PRIORITY_ASYNC_READ, * ZIO_PRIORITY_ASYNC_WRITE, * ZIO_PRIORITY_SCRUB, - * ZIO_PRIORITY_TRIM. + * ZIO_PRIORITY_TRIM, + * ZIO_PRIORITY_REBUILD. */ - if (priority == ZIO_PRIORITY_REBUILD) { - priority = ((type == ZIO_TYPE_WRITE) ? - ZIO_PRIORITY_ASYNC_WRITE : - ZIO_PRIORITY_SCRUB); - } else if (priority == ZIO_PRIORITY_INITIALIZING) { + if (priority == ZIO_PRIORITY_INITIALIZING) { ASSERT3U(type, ==, ZIO_TYPE_WRITE); priority = ZIO_PRIORITY_ASYNC_WRITE; } else if (priority == ZIO_PRIORITY_REMOVAL) { diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c index 04202a9f8..cdb4cb6e5 100644 --- a/module/zfs/vdev_label.c +++ b/module/zfs/vdev_label.c @@ -256,6 +256,9 @@ vdev_config_generate_stats(vdev_t *vd, nvlist_t *nv) fnvlist_add_uint64(nvx, ZPOOL_CONFIG_VDEV_TRIM_ACTIVE_QUEUE, vsx->vsx_active_queue[ZIO_PRIORITY_TRIM]); + fnvlist_add_uint64(nvx, ZPOOL_CONFIG_VDEV_REBUILD_ACTIVE_QUEUE, + vsx->vsx_active_queue[ZIO_PRIORITY_REBUILD]); + /* ZIOs pending */ fnvlist_add_uint64(nvx, ZPOOL_CONFIG_VDEV_SYNC_R_PEND_QUEUE, vsx->vsx_pend_queue[ZIO_PRIORITY_SYNC_READ]); @@ -275,6 +278,9 @@ vdev_config_generate_stats(vdev_t *vd, nvlist_t *nv) fnvlist_add_uint64(nvx, ZPOOL_CONFIG_VDEV_TRIM_PEND_QUEUE, vsx->vsx_pend_queue[ZIO_PRIORITY_TRIM]); + fnvlist_add_uint64(nvx, ZPOOL_CONFIG_VDEV_REBUILD_PEND_QUEUE, + vsx->vsx_pend_queue[ZIO_PRIORITY_REBUILD]); + /* Histograms */ fnvlist_add_uint64_array(nvx, ZPOOL_CONFIG_VDEV_TOT_R_LAT_HISTO, vsx->vsx_total_histo[ZIO_TYPE_READ], @@ -316,6 +322,10 @@ vdev_config_generate_stats(vdev_t *vd, nvlist_t *nv) vsx->vsx_queue_histo[ZIO_PRIORITY_TRIM], ARRAY_SIZE(vsx->vsx_queue_histo[ZIO_PRIORITY_TRIM])); + fnvlist_add_uint64_array(nvx, ZPOOL_CONFIG_VDEV_REBUILD_LAT_HISTO, + vsx->vsx_queue_histo[ZIO_PRIORITY_REBUILD], + ARRAY_SIZE(vsx->vsx_queue_histo[ZIO_PRIORITY_REBUILD])); + /* Request sizes */ fnvlist_add_uint64_array(nvx, ZPOOL_CONFIG_VDEV_SYNC_IND_R_HISTO, vsx->vsx_ind_histo[ZIO_PRIORITY_SYNC_READ], @@ -341,6 +351,10 @@ vdev_config_generate_stats(vdev_t *vd, nvlist_t *nv) vsx->vsx_ind_histo[ZIO_PRIORITY_TRIM], ARRAY_SIZE(vsx->vsx_ind_histo[ZIO_PRIORITY_TRIM])); + fnvlist_add_uint64_array(nvx, ZPOOL_CONFIG_VDEV_IND_REBUILD_HISTO, + vsx->vsx_ind_histo[ZIO_PRIORITY_REBUILD], + ARRAY_SIZE(vsx->vsx_ind_histo[ZIO_PRIORITY_REBUILD])); + fnvlist_add_uint64_array(nvx, ZPOOL_CONFIG_VDEV_SYNC_AGG_R_HISTO, vsx->vsx_agg_histo[ZIO_PRIORITY_SYNC_READ], ARRAY_SIZE(vsx->vsx_agg_histo[ZIO_PRIORITY_SYNC_READ])); @@ -365,6 +379,10 @@ vdev_config_generate_stats(vdev_t *vd, nvlist_t *nv) vsx->vsx_agg_histo[ZIO_PRIORITY_TRIM], ARRAY_SIZE(vsx->vsx_agg_histo[ZIO_PRIORITY_TRIM])); + fnvlist_add_uint64_array(nvx, ZPOOL_CONFIG_VDEV_AGG_REBUILD_HISTO, + vsx->vsx_agg_histo[ZIO_PRIORITY_REBUILD], + ARRAY_SIZE(vsx->vsx_agg_histo[ZIO_PRIORITY_REBUILD])); + /* IO delays */ fnvlist_add_uint64(nvx, ZPOOL_CONFIG_VDEV_SLOW_IOS, vs->vs_slow_ios); |