Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2018 16:37:38 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
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
Message-ID:  <201808211637.w7LGbcuu028962@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808211637.w7LGbcuu028962>