mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Call gethrtime() only once per new txg creation
When transitioning current open TXG into QUIESCE state and opening a new one txg_quiesce() calls gethrtime(): - to mark the birth time of the new TXG - to record the SPA txg history kstat - implicitely inside spa_txg_history_add() These timestamps are practically the same, so that the first one can be used instead of the other two. The only visible difference is that inside spa_txg_history_add() the time spent in kmem_zalloc() will be counted towards the opened TXG. Since at this point the new TXG already exists (tx->tx_open_txg has been already incremented) it is actually a correct accounting. In any case this extra work is only happening when spa_txg_history kstat is activated (i.e. zfs_txg_history > 0) and doesn't affect the normal processing in any way. Signed-off-by: Cyril Plisko <cyril.plisko@mountall.com> Issue #2075
This commit is contained in:
committed by
Brian Behlendorf
parent
478d64fdae
commit
01b738f457
+2
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user