summaryrefslogtreecommitdiffstats
path: root/module/zfs/txg.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2017-12-12 15:46:58 -0800
committerBrian Behlendorf <[email protected]>2018-10-04 13:13:28 -0700
commitdfbe26750308d757d20af8eb5aefef49ec65d4a8 (patch)
treea06a369cecdbe4cd70627fbe44b9344cc95b7a29 /module/zfs/txg.c
parent58c0f374f101a37b5e1bb22359f40020f235e008 (diff)
OpenZFS 9617 - too-frequent TXG sync causes excessive write inflation
Porting notes: * Renamed zfs_dirty_data_sync_pct to zfs_dirty_data_sync_percent and changed the type to be consistent with the other dirty module params. * Updated zfs-module-parameters.5 accordingly. Authored by: Matthew Ahrens <[email protected]> Reviewed by: Serapheim Dimitropoulos <[email protected]> Reviewed by: Brad Lewis <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Andrew Stormont <[email protected]> Reviewed-by: George Melikov <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://illumos.org/issues/9617 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/7928f4ba Closes #7976
Diffstat (limited to 'module/zfs/txg.c')
-rw-r--r--module/zfs/txg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/txg.c b/module/zfs/txg.c
index cfc1d0a35..aad1a8e57 100644
--- a/module/zfs/txg.c
+++ b/module/zfs/txg.c
@@ -517,7 +517,8 @@ txg_sync_thread(void *arg)
clock_t timeout = zfs_txg_timeout * hz;
clock_t timer;
uint64_t txg;
- txg_stat_t *ts;
+ uint64_t dirty_min_bytes =
+ zfs_dirty_data_max * zfs_dirty_data_sync_percent / 100;
/*
* We sync when we're scanning, there's someone waiting
@@ -529,7 +530,7 @@ txg_sync_thread(void *arg)
!tx->tx_exiting && timer > 0 &&
tx->tx_synced_txg >= tx->tx_sync_txg_waiting &&
!txg_has_quiesced_to_sync(dp) &&
- dp->dp_dirty_total < zfs_dirty_data_sync) {
+ dp->dp_dirty_total < dirty_min_bytes) {
dprintf("waiting; tx_synced=%llu waiting=%llu dp=%p\n",
tx->tx_synced_txg, tx->tx_sync_txg_waiting, dp);
txg_thread_wait(tx, &cpr, &tx->tx_sync_more_cv, timer);
@@ -561,7 +562,7 @@ txg_sync_thread(void *arg)
tx->tx_quiesced_txg = 0;
tx->tx_syncing_txg = txg;
DTRACE_PROBE2(txg__syncing, dsl_pool_t *, dp, uint64_t, txg);
- ts = spa_txg_history_init_io(spa, txg, dp);
+ txg_stat_t *ts = spa_txg_history_init_io(spa, txg, dp);
cv_broadcast(&tx->tx_quiesce_more_cv);
dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",