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
This commit is contained in:
markj 2018-08-21 16:37:37 +00:00
parent 03518d5ee1
commit 34a02309fa

View File

@ -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_RW,
&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