From 945275591d4027b3d176d67f7aca89bd98311036 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 28 Apr 2016 13:52:18 +0200 Subject: [PATCH 233/257] ZFS: Add a sysctl to access the lowest write buffer limit Obtained from: ElectroBSD --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 6cc268812cde..51ded24b981f 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 @@ -52,6 +52,11 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dynamic_write_buffer_hits, CTLFLAG_RWTUN, &zfs_dynamic_write_buffer_hits, 0, "Number of times the dynamic write buffer was limitted"); +static uint64_t zfs_lowest_dynamic_write_buffer_limit = 0; +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, lowest_dynamic_write_buffer_limit, CTLFLAG_RD, + &zfs_lowest_dynamic_write_buffer_limit, 0, + "The lowest value the dynamic write buffer was limitted to"); + dmu_tx_t * dmu_tx_create_dd(dsl_dir_t *dd) { @@ -1392,6 +1397,10 @@ dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how) if (zfs_dirty_data_max_internal < zfs_dirty_data_max) { zfs_dynamic_write_buffer_hits++; } + if (zfs_lowest_dynamic_write_buffer_limit == 0 || + zfs_lowest_dynamic_write_buffer_limit >= zfs_dirty_data_max_internal) { + zfs_lowest_dynamic_write_buffer_limit = zfs_dirty_data_max_internal; + } } else { zfs_dirty_data_max_internal = zfs_dirty_data_max; } -- 2.11.0