diff --git a/module/zfs/arc.c b/module/zfs/arc.c index fe47d714a..0a09c443b 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -6508,16 +6508,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;