summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-09-10 01:46:47 +0000
committerdelphij <delphij@FreeBSD.org>2013-09-10 01:46:47 +0000
commita23043347caa65ac4c8e91f806ab2319dbbd657c (patch)
tree0687bff9ba2d5136268f4e5308ff47b239b85978 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
parent545d815a3b9493ec2dee3f291049b47655c1ec46 (diff)
downloadFreeBSD-src-a23043347caa65ac4c8e91f806ab2319dbbd657c.zip
FreeBSD-src-a23043347caa65ac4c8e91f806ab2319dbbd657c.tar.gz
MFV r247844 (illumos-gate 13975:ef6409bc370f)
Illumos ZFS issues: 3582 zfs_delay() should support a variable resolution 3584 DTrace sdt probes for ZFS txg states Provide a compatibility shim for Solaris's cv_timedwait_hires to help aid future porting. Approved by: re (ZFS blanket)
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
index d7949e8..963fd1c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
@@ -85,6 +85,9 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, write_limit_override, CTLFLAG_RDTUN,
&zfs_write_limit_override, 0,
"Force a txg if dirty buffers exceed this value (bytes)");
+hrtime_t zfs_throttle_delay = MSEC2NSEC(10);
+hrtime_t zfs_throttle_resolution = MSEC2NSEC(10);
+
int
dsl_pool_open_special_dir(dsl_pool_t *dp, const char *name, dsl_dir_t **ddp)
{
@@ -538,12 +541,13 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t txg)
* Weight the throughput calculation towards the current value:
* thru = 3/4 old_thru + 1/4 new_thru
*
- * Note: write_time is in nanosecs, so write_time/MICROSEC
- * yields millisecs
+ * Note: write_time is in nanosecs while dp_throughput is expressed in
+ * bytes per millisecond.
*/
ASSERT(zfs_write_limit_min > 0);
- if (data_written > zfs_write_limit_min / 8 && write_time > MICROSEC) {
- uint64_t throughput = data_written / (write_time / MICROSEC);
+ if (data_written > zfs_write_limit_min / 8 &&
+ write_time > MSEC2NSEC(1)) {
+ uint64_t throughput = data_written / NSEC2MSEC(write_time);
if (dp->dp_throughput)
dp->dp_throughput = throughput / 4 +
@@ -641,8 +645,10 @@ dsl_pool_tempreserve_space(dsl_pool_t *dp, uint64_t space, dmu_tx_t *tx)
* the caller 1 clock tick. This will slow down the "fill"
* rate until the sync process can catch up with us.
*/
- if (reserved && reserved > (write_limit - (write_limit >> 3)))
- txg_delay(dp, tx->tx_txg, 1);
+ if (reserved && reserved > (write_limit - (write_limit >> 3))) {
+ txg_delay(dp, tx->tx_txg, zfs_throttle_delay,
+ zfs_throttle_resolution);
+ }
return (0);
}
OpenPOWER on IntegriCloud