diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index d33da62f42cb..7f010c6cfc5b 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -304,6 +304,17 @@ arc_c shift to calc min/max arc_p Default value: \fB4\fR. .RE +.sp +.ne 2 +.na +\fBzfs_arc_p_aggressive_disable\fR (int) +.ad +.RS 12n +Disable aggressive arc_p growth +.sp +Use \fB1\fR for yes (default) and \fB0\fR to disable. +.RE + .sp .ne 2 .na diff --git a/module/zfs/arc.c b/module/zfs/arc.c index cbc9b9feeb97..eac6ea4488fc 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -175,6 +175,9 @@ int zfs_arc_grow_retry = 5; /* shift of arc_c for calculating both min and max arc_p */ int zfs_arc_p_min_shift = 4; +/* disable anon data aggressively growing arc_p */ +int zfs_arc_p_aggressive_disable = 1; + /* log2(fraction of arc to reclaim) */ int zfs_arc_shrink_shift = 5; @@ -2798,7 +2801,8 @@ arc_get_data_buf(arc_buf_t *buf) * If we are growing the cache, and we are adding anonymous * data, and we have outgrown arc_p, update arc_p */ - if (arc_size < arc_c && hdr->b_state == arc_anon && + if (!zfs_arc_p_aggressive_disable && + arc_size < arc_c && hdr->b_state == arc_anon && arc_anon->arcs_size + arc_mru->arcs_size > arc_p) arc_p = MIN(arc_c, arc_p + size); } @@ -5553,6 +5557,9 @@ MODULE_PARM_DESC(zfs_arc_meta_prune, "Bytes of meta data to prune"); module_param(zfs_arc_grow_retry, int, 0644); MODULE_PARM_DESC(zfs_arc_grow_retry, "Seconds before growing arc size"); +module_param(zfs_arc_p_aggressive_disable, int, 0644); +MODULE_PARM_DESC(zfs_arc_p_aggressive_disable, "disable aggressive arc_p grow"); + module_param(zfs_arc_shrink_shift, int, 0644); MODULE_PARM_DESC(zfs_arc_shrink_shift, "log2(fraction of arc to reclaim)");