diff --git a/include/sys/spa.h b/include/sys/spa.h index 0079c18fea34..e7cbff806d98 100644 --- a/include/sys/spa.h +++ b/include/sys/spa.h @@ -566,7 +566,7 @@ 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_t *zb, uint32_t aflags); -extern void spa_txg_history_add(spa_t *spa, uint64_t txg); +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, diff --git a/module/zfs/spa_stats.c b/module/zfs/spa_stats.c index 2576d867fb92..a94fecfe87f8 100644 --- a/module/zfs/spa_stats.c +++ b/module/zfs/spa_stats.c @@ -422,7 +422,7 @@ spa_txg_history_destroy(spa_t *spa) * Add a new txg to historical record. */ void -spa_txg_history_add(spa_t *spa, uint64_t txg) +spa_txg_history_add(spa_t *spa, uint64_t txg, hrtime_t birth_time) { spa_stats_history_t *ssh = &spa->spa_stats.txg_history; spa_txg_history_t *sth, *rm; @@ -433,7 +433,7 @@ spa_txg_history_add(spa_t *spa, uint64_t txg) sth = kmem_zalloc(sizeof (spa_txg_history_t), KM_PUSHPAGE); sth->txg = txg; sth->state = TXG_STATE_OPEN; - sth->times[TXG_STATE_BIRTH] = gethrtime(); + sth->times[TXG_STATE_BIRTH] = birth_time; mutex_enter(&ssh->lock); diff --git a/module/zfs/txg.c b/module/zfs/txg.c index 89615a21a404..9e9db9989fb7 100644 --- a/module/zfs/txg.c +++ b/module/zfs/txg.c @@ -377,8 +377,8 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg) tx->tx_open_txg++; tx->tx_open_time = gethrtime(); - spa_txg_history_set(dp->dp_spa, txg, TXG_STATE_OPEN, gethrtime()); - spa_txg_history_add(dp->dp_spa, tx->tx_open_txg); + spa_txg_history_set(dp->dp_spa, txg, TXG_STATE_OPEN, tx->tx_open_time); + spa_txg_history_add(dp->dp_spa, tx->tx_open_txg, tx->tx_open_time); DTRACE_PROBE2(txg__quiescing, dsl_pool_t *, dp, uint64_t, txg); DTRACE_PROBE2(txg__opened, dsl_pool_t *, dp, uint64_t, tx->tx_open_txg);