]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Set zfs_arc_min to 4MB
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 23 Jul 2013 22:33:23 +0000 (15:33 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Feb 2014 22:52:02 +0000 (14:52 -0800)
Decrease the mimimum ARC size from 1/32 of total system memory
(or 64MB) to a much smaller 4MB.

1) Large systems with over a 1TB of memory are being deployed
   and reserving 1/32 of this memory (32GB) as the mimimum
   requirement is overkill.

2) Tiny systems like the raspberry pi may only have 256MB of
   memory in which case 64MB is far too large.

The ARC should be reclaimable if the VFS determines it needs
the memory for some other purpose.  If you want to ensure the
ARC is never completely reclaimed due to memory pressure you
may still set a larger value with zfs_arc_min.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Issue #2110

module/zfs/arc.c

index cbe0a6028cd3fa52f4215b60a268e08b9750bbe4..11839af59c9f607d4ae4b5ffdb560a76fabd5b53 100644 (file)
@@ -4025,8 +4025,8 @@ arc_init(void)
        spl_register_shrinker(&arc_shrinker);
 #endif
 
-       /* set min cache to 1/32 of all memory, or 64MB, whichever is more */
-       arc_c_min = MAX(arc_c / 4, 64<<20);
+       /* set min cache to zero */
+       arc_c_min = 4<<20;
        /* set max to 1/2 of all memory */
        arc_c_max = arc_c * 4;
 
@@ -4036,7 +4036,7 @@ arc_init(void)
         */
        if (zfs_arc_max > 64<<20 && zfs_arc_max < physmem * PAGESIZE)
                arc_c_max = zfs_arc_max;
-       if (zfs_arc_min > 64<<20 && zfs_arc_min <= arc_c_max)
+       if (zfs_arc_min > 0 && zfs_arc_min <= arc_c_max)
                arc_c_min = zfs_arc_min;
 
        arc_c = arc_c_max;
@@ -4050,9 +4050,6 @@ arc_init(void)
        if (zfs_arc_meta_limit > 0 && zfs_arc_meta_limit <= arc_c_max)
                arc_meta_limit = zfs_arc_meta_limit;
 
-       if (arc_c_min < arc_meta_limit / 2 && zfs_arc_min == 0)
-               arc_c_min = arc_meta_limit / 2;
-
        /* if kmem_flags are set, lets try to use less memory */
        if (kmem_debugging())
                arc_c = arc_c / 2;