diff options
author | Brian Behlendorf <[email protected]> | 2017-09-20 09:36:17 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2017-09-20 09:36:17 -0700 |
commit | 4ce3c45a5e30a6ee698ea60be381c774050093ed (patch) | |
tree | 2bbdff8e2ffb013c81c0855569ec5bf2f8a9926e /module/zfs/arc.c | |
parent | 848259c10f08694fd57c005aeb5ca8d724f046b6 (diff) |
Increase default arc_c_min
Increase the default arc_c_min value to which whichever is larger,
either 32M or 1/32 of total system memory. This is advantageous for
systems with more than 1G of memory where performance issues may
occur when the ARC is allowed to collapse below a minimum size.
At the same time we want to use the bare minimum value which is
still functional so the filesystem can be used in very low memory
environments.
Reviewed-by: Tim Chase <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #6659
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r-- | module/zfs/arc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 57bf6b83c..ed093fac1 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -7353,16 +7353,17 @@ arc_init(void) /* Set max to 1/2 of all memory */ arc_c_max = allmem / 2; +#ifdef _KERNEL + /* Set min cache to 1/32 of all memory, or 32MB, whichever is more */ + arc_c_min = MAX(allmem / 32, 2ULL << SPA_MAXBLOCKSHIFT); +#else /* * In userland, there's only the memory pressure that we artificially * create (see arc_available_memory()). Don't let arc_c get too * small, because it can cause transactions to be larger than * arc_c, causing arc_tempreserve_space() to fail. */ -#ifndef _KERNEL arc_c_min = MAX(arc_c_max / 2, 2ULL << SPA_MAXBLOCKSHIFT); -#else - arc_c_min = 2ULL << SPA_MAXBLOCKSHIFT; #endif arc_c = arc_c_max; |