aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/spa.h
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2016-12-02 16:57:49 -0700
committerGitHub <[email protected]>2016-12-02 16:57:49 -0700
commitbaf67d15a59025fb53fc60bf439ef291397366e8 (patch)
treed6c71227595717eb14a8eaeae5189abdc04aad1c /include/sys/spa.h
parent6c09d3e5a04db023536aab467064cad3f7858776 (diff)
Refactor txg history kstat
It was observed that even when the txg history is disabled by setting `zfs_txg_history=0` the txg_sync thread still fetches the vdev stats unnecessarily. This patch refactors the code such that vdev_get_stats() is no longer called when `zfs_txg_history=0`. And it further reduces the differences between upstream and the ZoL txg_sync_thread() function. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #5412
Diffstat (limited to 'include/sys/spa.h')
-rw-r--r--include/sys/spa.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/sys/spa.h b/include/sys/spa.h
index d679e53d6..58520118e 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -725,6 +725,13 @@ typedef enum txg_state {
TXG_STATE_COMMITTED = 5,
} txg_state_t;
+typedef struct txg_stat {
+ vdev_stat_t vs1;
+ vdev_stat_t vs2;
+ uint64_t txg;
+ uint64_t ndirty;
+} txg_stat_t;
+
extern void spa_stats_init(spa_t *spa);
extern void spa_stats_destroy(spa_t *spa);
extern void spa_read_history_add(spa_t *spa, const zbookmark_phys_t *zb,
@@ -732,8 +739,9 @@ extern void spa_read_history_add(spa_t *spa, const zbookmark_phys_t *zb,
extern void spa_txg_history_add(spa_t *spa, uint64_t txg, hrtime_t birth_time);
extern int spa_txg_history_set(spa_t *spa, uint64_t txg,
txg_state_t completed_state, hrtime_t completed_time);
-extern int spa_txg_history_set_io(spa_t *spa, uint64_t txg, uint64_t nread,
- uint64_t nwritten, uint64_t reads, uint64_t writes, uint64_t ndirty);
+extern txg_stat_t *spa_txg_history_init_io(spa_t *, uint64_t,
+ struct dsl_pool *);
+extern void spa_txg_history_fini_io(spa_t *, txg_stat_t *);
extern void spa_tx_assign_add_nsecs(spa_t *spa, uint64_t nsecs);
/* Pool configuration locks */