From owner-svn-src-head@freebsd.org Tue Aug 21 16:37:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F0C01077EBC; Tue, 21 Aug 2018 16:37:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 554838B3CA; Tue, 21 Aug 2018 16:37:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 372E526863; Tue, 21 Aug 2018 16:37:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7LGbcIc028963; Tue, 21 Aug 2018 16:37:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7LGbcuu028962; Tue, 21 Aug 2018 16:37:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808211637.w7LGbcuu028962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Aug 2018 16:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338142 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 338142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2018 16:37:38 -0000 Author: markj Date: Tue Aug 21 16:37:37 2018 New Revision: 338142 URL: https://svnweb.freebsd.org/changeset/base/338142 Log: Set arc_kmem_cache_reap_retry_ms to 0 and make it configurable. r329759 introduced this parameter, which controls the rate at which ZFS UMA zones are drained when the ARC reclaim thread is shrinking the ARC. The reclamation target is derived from the global free page count, and arc_shrink() only frees buffers back to UMA, so the free page count is not updated until the zones are drained. Thus, back-to-back calls to arc_shrink() within the arc_kmem_cache_reap_retry_ms interval do not provide immediate feedback to the arc_reclaim control loop, so we may free more of the ARC than needed to address a transient page shortage. As we do not implement the asynchronous zone draining added in r329759, disable the retry interval, restoring pre-r329759 behaviour. That is, we will drain the ZFS UMA zones before each attempt to shrink the ARC. Reviewed by: mav MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 21 15:30:47 2018 (r338141) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 21 16:37:37 2018 (r338142) @@ -320,7 +320,7 @@ int zfs_arc_evict_batch_limit = 10; static int arc_grow_retry = 60; /* number of milliseconds before attempting a kmem-cache-reap */ -static int arc_kmem_cache_reap_retry_ms = 1000; +static int arc_kmem_cache_reap_retry_ms = 0; /* shift of arc_c for calculating overflow limit in arc_get_data_impl */ int zfs_arc_overflow_shift = 8; @@ -435,7 +435,11 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_grow_retry, CTLFLAG &arc_grow_retry, 0, "Wait in seconds before considering growing ARC"); SYSCTL_INT(_vfs_zfs, OID_AUTO, compressed_arc_enabled, CTLFLAG_RDTUN, - &zfs_compressed_arc_enabled, 0, "Enable compressed ARC"); + &zfs_compressed_arc_enabled, 0, + "Enable compressed ARC"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_kmem_cache_reap_retry_ms, CTLFLAG_RWTUN, + &arc_kmem_cache_reap_retry_ms, 0, + "Interval between ARC kmem_cache reapings"); /* * We don't have a tunable for arc_free_target due to the dependency on