From 750e1f88d386b752283de7ed763af2a189b73677 Mon Sep 17 00:00:00 2001 From: Feng Sun Date: Thu, 26 Jul 2018 00:52:27 +0800 Subject: [PATCH] Introduce kstat dmu_tx_dirty_frees_delay It is helpful to tune zfs_per_txg_dirty_frees_percent for commit 539d33c7(OpenZFS 6569 - large file delete can starve out write ops). Reviewed-by: Brian Behlendorf Reviewed by: Richard Elling Signed-off-by: Feng Sun Closes #7718 --- include/sys/dmu_tx.h | 1 + module/zfs/dmu.c | 1 + module/zfs/dmu_tx.c | 1 + 3 files changed, 3 insertions(+) diff --git a/include/sys/dmu_tx.h b/include/sys/dmu_tx.h index 74b7e11163..6a4bd3fac2 100644 --- a/include/sys/dmu_tx.h +++ b/include/sys/dmu_tx.h @@ -124,6 +124,7 @@ typedef struct dmu_tx_stats { kstat_named_t dmu_tx_dirty_throttle; kstat_named_t dmu_tx_dirty_delay; kstat_named_t dmu_tx_dirty_over_max; + kstat_named_t dmu_tx_dirty_frees_delay; kstat_named_t dmu_tx_quota; } dmu_tx_stats_t; diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 0d2f03e22c..9d00098c8b 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -826,6 +826,7 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset, */ if (dirty_frees_threshold != 0 && long_free_dirty_all_txgs >= dirty_frees_threshold) { + DMU_TX_STAT_BUMP(dmu_tx_dirty_frees_delay); txg_wait_open(dp, 0); continue; } diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c index ab6ec29e77..c63ba6405a 100644 --- a/module/zfs/dmu_tx.c +++ b/module/zfs/dmu_tx.c @@ -53,6 +53,7 @@ dmu_tx_stats_t dmu_tx_stats = { { "dmu_tx_dirty_throttle", KSTAT_DATA_UINT64 }, { "dmu_tx_dirty_delay", KSTAT_DATA_UINT64 }, { "dmu_tx_dirty_over_max", KSTAT_DATA_UINT64 }, + { "dmu_tx_dirty_frees_delay", KSTAT_DATA_UINT64 }, { "dmu_tx_quota", KSTAT_DATA_UINT64 }, };