From: Brian Behlendorf Date: Fri, 1 Feb 2013 17:33:04 +0000 (-0800) Subject: Add zfs_arc_memory_throttle_disable module option X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=0c5493d47059f25ce9dbf20c9fe87655f55102a1;p=zfs.git Add zfs_arc_memory_throttle_disable module option 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 Closes #938 --- diff --git a/module/zfs/arc.c b/module/zfs/arc.c index eab1b16..09924db 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -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; @@ -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(); @@ -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");