summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/arc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 074163369..c3d88679f 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -5343,8 +5343,18 @@ arc_init(void)
arc_need_free = 0;
#endif
- /* Set min cache to allow safe operation of arc_adapt() */
+ /*
+ * 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 = arc_c_max / 2;
+#else
arc_c_min = 2ULL << SPA_MAXBLOCKSHIFT;
+#endif
+
/* Set max to 1/2 of all memory */
arc_c_max = allmem / 2;