Date: Fri, 16 May 2014 16:07:43 GMT From: Nathaniel Filardo <nwf@cs.jhu.edu> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/189865: zfs_dirty_data_max{, _max, _percent} not exported as loader tunables Message-ID: <201405161607.s4GG7hY1098490@cgiserv.freebsd.org> Resent-Message-ID: <201405161610.s4GGA1l2006532@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 189865 >Category: kern >Synopsis: zfs_dirty_data_max{,_max,_percent} not exported as loader tunables >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 16 16:10:01 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Nathaniel Filardo >Release: 9.2-STABLE >Organization: IETFNG.org >Environment: FreeBSD hydra.priv.oc.ietfng.org 9.2-STABLE FreeBSD 9.2-STABLE #132 9089443-dirty: Wed Apr 30 22:02:57 EDT 2014 root@hydra.priv.oc.ietfng.org:/usr/obj/systank/src-git/sys/NWFKERN sparc64 >Description: On machines with gobs of RAM, zfs_dirty_data_max is zfs_dirty_data_max_percent (i.e. 10) percent of memory or zfs_dirty_data_max_max (ie 4G) which may take tens of minutes to sync to disk, especially if data is spread out across the disk, during which time any program that attempts to write to disk eventually stalls because there are at most three txgs pending. It would be nice to limit transactions to something smaller so that these latency spikes go away. >How-To-Repeat: >Fix: I think something like the following (compiled but untested) patch would do the trick? 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 9fe1961..f5aa000 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 @@ -132,6 +132,22 @@ uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000; SYSCTL_DECL(_vfs_zfs); + +TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent); +SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN, + &zfs_dirty_data_max_percent, 0, + "Maximum percent of physical memory allocated to dirty data"); + +TUNABLE_QUAD("vfs.zfs.dirty_data_max", &zfs_dirty_data_max); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max, CTLFLAG_RDTUN, + &zfs_dirty_data_max, 0, + "Force a txg if dirty buffers exceed this value (bytes)"); + +TUNABLE_QUAD("vfs.zfs.dirty_data_max_max", &zfs_dirty_data_max_max); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN, + &zfs_dirty_data_max_max, 0, + "Limit dirty_data_max when using dirty_data_max_percent"); + #if 0 TUNABLE_INT("vfs.zfs.no_write_throttle", &zfs_no_write_throttle); SYSCTL_INT(_vfs_zfs, OID_AUTO, no_write_throttle, CTLFLAG_RDTUN, >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405161607.s4GG7hY1098490>