Skip to content

Commit

Permalink
Add zfs_arc_memory_throttle_disable module option
Browse files Browse the repository at this point in the history
The way in which virtual box ab(uses) memory can throw off the
free memory calculation in arc_memory_throttle().  The result is
the txg_sync thread will effectively spin waiting for memory to
be released even though there's lots of memory on the system.

To handle this case I'm adding a zfs_arc_memory_throttle_disable
module option largely for virtual box users.  Setting this option
disables free memory checks which allows the txg_sync thread to
make progress.

By default this option is disabled to preserve the current
behavior.  However, because Linux supports direct memory reclaim
it's doubtful throttling due to perceived memory pressure is ever
a good idea.  We should enable this option by default once we've
done enough real world testing to convince ourselve there aren't
any unexpected side effects.

Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#938
  • Loading branch information
behlendorf committed Feb 1, 2013
1 parent 1f7c30d commit 0c5493d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ unsigned long zfs_arc_meta_limit = 0;
int zfs_arc_grow_retry = 0;
int zfs_arc_shrink_shift = 0;
int zfs_arc_p_min_shift = 0;
int zfs_arc_memory_throttle_disable = 0;
int zfs_disable_dup_eviction = 0;
int zfs_arc_meta_prune = 0;

Expand Down Expand Up @@ -3633,6 +3634,9 @@ arc_memory_throttle(uint64_t reserve, uint64_t inflight_data, uint64_t txg)
#ifdef _KERNEL
uint64_t available_memory;

if (zfs_arc_memory_throttle_disable)
return (0);

/* Easily reclaimable memory (free + inactive + arc-evictable) */
available_memory = ptob(spl_kmem_availrmem()) + arc_evictable_memory();

Expand Down Expand Up @@ -5045,6 +5049,9 @@ MODULE_PARM_DESC(zfs_arc_p_min_shift, "arc_c shift to calc min/max arc_p");
module_param(zfs_disable_dup_eviction, int, 0644);
MODULE_PARM_DESC(zfs_disable_dup_eviction, "disable duplicate buffer eviction");

module_param(zfs_arc_memory_throttle_disable, int, 0644);
MODULE_PARM_DESC(zfs_arc_memory_throttle_disable, "disable memory throttle");

module_param(l2arc_write_max, ulong, 0444);
MODULE_PARM_DESC(l2arc_write_max, "Max write bytes per interval");

Expand Down

0 comments on commit 0c5493d

Please sign in to comment.