From owner-freebsd-bugs@FreeBSD.ORG Fri May 16 16:10:02 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18AD28F for ; Fri, 16 May 2014 16:10:02 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E97412EFB for ; Fri, 16 May 2014 16:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GGA1gZ006533 for ; Fri, 16 May 2014 16:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4GGA1l2006532; Fri, 16 May 2014 16:10:01 GMT (envelope-from gnats) Resent-Date: Fri, 16 May 2014 16:10:01 GMT Resent-Message-Id: <201405161610.s4GGA1l2006532@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nathaniel Filardo Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83F93FCF for ; Fri, 16 May 2014 16:07:44 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 574F62EE5 for ; Fri, 16 May 2014 16:07:44 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GG7hE0098491 for ; Fri, 16 May 2014 16:07:43 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s4GG7hY1098490; Fri, 16 May 2014 16:07:43 GMT (envelope-from nobody) Message-Id: <201405161607.s4GG7hY1098490@cgiserv.freebsd.org> Date: Fri, 16 May 2014 16:07:43 GMT From: Nathaniel Filardo To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/189865: zfs_dirty_data_max{, _max, _percent} not exported as loader tunables X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 16:10:02 -0000 >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: