NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: zfs pool behavior - is it ever freed?



On Thu, 27 Jul 2023 06:43:45 -0400
Greg Troxel <gdt%lexort.com@localhost> wrote:

>   Thus it seems there is a limit for zfs usage, but it is simply
>   sometimes too high depending on available RAM.

I use this patch on my RPi4, which I feel improves things.
People might find it helpful.
There ought to be writable sysctl knobs for some of the ZFS
tuneables, but looks like it isn't implemented in NetBSD yet.

--- external/cddl/osnet/dist/uts/common/fs/zfs/arc.c	3 Aug 2022 01:53:06 -0000	1.22
+++ external/cddl/osnet/dist/uts/common/fs/zfs/arc.c	27 Jul 2023 11:10:40 -0000
@@ -6100,6 +6100,10 @@ arc_init(void)
 	else
 		arc_c_max = arc_c_min;
 	arc_c_max = MAX(arc_c * 5, arc_c_max);
+#if defined(__NetBSD__) && defined(_KERNEL)
+/* XXX prevent ARC from eating more than 12% of kmem */
+	arc_c_max = MIN(arc_c, vmem_size(heap_arena, VMEM_ALLOC | VMEM_FREE) / 8);
+#endif

 	/*
 	 * In userland, there's only the memory pressure that we artificially



Home | Main Index | Thread Index | Old Index