From 34aaa9a0fc127ec321a1ca8cfcc1f1ece6983d4b Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 3 May 2016 16:13:29 +0200 Subject: [PATCH 237/257] dmu_tx_assign(): Limit zfs_dirty_data_max_internal growth ... to steps of zfs_dirty_data_max_min or less. As dmu_tx_assign() is called quite frequently the growth should probably additionally be delayed based on time, though. Obtained from: ElectroBSD --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c index 7c1e3a6df36a..6342d397928a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c @@ -1346,7 +1346,7 @@ int dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how) { int err; - static uint64_t last_max; + static uint64_t last_max = 4ULL * 1024 * 1024 * 1024; ASSERT(tx->tx_txg == 0); ASSERT(txg_how == TXG_WAIT || txg_how == TXG_NOWAIT || @@ -1390,9 +1390,10 @@ dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how) zfs_dirty_data_max_internal = MIN(zfs_dirty_data_max_internal, ptob(vm_cnt.v_free_count / 2)); } - if (last_max != (zfs_dirty_data_max_internal / (1024 * 1024))) { - last_max = zfs_dirty_data_max_internal / (1024 * 1024); - DTRACE_PROBE1(dmu__tx_dirty, uint64_t, last_max); + zfs_dirty_data_max_internal = MIN(last_max + zfs_dirty_data_max_min, zfs_dirty_data_max_internal); + if (last_max != zfs_dirty_data_max_internal) { + last_max = zfs_dirty_data_max_internal; + DTRACE_PROBE1(dmu__tx_dirty, uint64_t, last_max / (1024 * 1024)); } zfs_dirty_data_max_internal = MAX(zfs_dirty_data_max_internal, zfs_dirty_data_max_min); if (zfs_dirty_data_max_internal < zfs_dirty_data_max) { -- 2.11.0