diff options
author | Ned Bass <[email protected]> | 2014-02-27 16:32:36 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-03-04 12:22:24 -0800 |
commit | 3ccab25205cc8836ceb79bbd164208021468233a (patch) | |
tree | c16c14ea1aea2c71364df3b6efa213c8ba7f4c11 /module/zfs/txg.c | |
parent | 3d920a1567d550273413a741c5fbece42cea6f00 (diff) |
replace nreserved with ndirty in txgs kstat
The nreserved column in the txgs kstat file always contains 0
following the write throttle restructuring of commit
e8b96c6007bf97cdf34869c1ffbd0ce753873a3d.
Prior to that commit, the nreserved column showed the number of bytes
temporarily reserved in the pool by a transaction group at sync time.
The new write throttle did away with temporary reservations and uses
the amount of dirty data instead. To approximate the old output of
the txgs kstat, the number of dirty bytes per-txg was passed in as
the nreserved value to spa_txg_history_set_io(). This approach did
not work as intended, because the per-txg dirty value is decremented
as data is written out to disk, so it is zero by the time we call
spa_txg_history_set_io(). To fix this, save the number of dirty
bytes before calling spa_sync(), and pass this value in to
spa_txg_history_set_io().
Also, since the name "nreserved" is now a misnomer, the column
heading is now labeled "ndirty".
Signed-off-by: Ned Bass <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #1696
Diffstat (limited to 'module/zfs/txg.c')
-rw-r--r-- | module/zfs/txg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/txg.c b/module/zfs/txg.c index 9e9db9989..524fe8e84 100644 --- a/module/zfs/txg.c +++ b/module/zfs/txg.c @@ -500,6 +500,7 @@ txg_sync_thread(dsl_pool_t *dp) for (;;) { uint64_t timer, timeout; uint64_t txg; + uint64_t ndirty; timeout = zfs_txg_timeout * hz; @@ -557,6 +558,7 @@ txg_sync_thread(dsl_pool_t *dp) spa_txg_history_set(spa, txg, TXG_STATE_WAIT_FOR_SYNC, gethrtime()); + ndirty = dp->dp_dirty_pertxg[txg & TXG_MASK]; start = ddi_get_lbolt(); spa_sync(spa, txg); @@ -579,7 +581,7 @@ txg_sync_thread(dsl_pool_t *dp) vs2->vs_bytes[ZIO_TYPE_WRITE]-vs1->vs_bytes[ZIO_TYPE_WRITE], vs2->vs_ops[ZIO_TYPE_READ]-vs1->vs_ops[ZIO_TYPE_READ], vs2->vs_ops[ZIO_TYPE_WRITE]-vs1->vs_ops[ZIO_TYPE_WRITE], - dp->dp_dirty_pertxg[txg & TXG_MASK]); + ndirty); spa_txg_history_set(spa, txg, TXG_STATE_SYNCED, gethrtime()); } } |