From 3c737dbe53e4967132532faf8bf7e00f834bbf28 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 25 Jan 2016 13:32:24 +0100 Subject: [PATCH 225/257] ZFS ARC: If there's less than 1 GB of RAM, set the ARC max to 50% of it Now the code matches the comment again. The limit was increased to 6/8 in r172130 and reduced to 5/8 in r175633 again to mitigate 'kmem_map too small panics'. As it turns out, 5/8 is still too much and can result in deadlocks caused by the vm system running out of pages: (kgdb) p vm_cnt $7 = {v_swtch = 0, v_trap = 0, v_syscall = 0, v_intr = 0, v_soft = 0, v_vm_faults = 0, v_io_faults = 0, v_cow_faults = 0, v_cow_optim = 0, v_zfod = 0, v_ozfod = 0, v_swapin = 0, v_swapout = 0, v_swappgsin = 0, v_swappgsout = 0, v_vnodein = 0, v_vnodeout = 0, v_vnodepgsin = 0, v_vnodepgsout = 0, v_intrans = 0, v_reactivated = 0, v_pdwakeups = 878, v_pdpages = 0, v_tcached = 0, v_dfree = 0, v_pfree = 0, v_tfree = 0, v_page_size = 4096, v_page_count = 247933, v_free_reserved = 372, v_free_target = 5324, v_free_min = 1610, v_free_count = 2, v_wire_count = 72901, v_active_count = 174634, v_inactive_target = 7986, v_inactive_count = 395, v_cache_count = 0, v_pageout_free_min = 34, v_interrupt_free_min = 2, v_free_severe = 991, v_forks = 0, v_vforks = 0, v_rforks = 0, v_kthreads = 0, v_forkpages = 0, v_vforkpages = 0, v_rforkpages = 0, v_kthreadpages = 0, v_spare = 0xffffffff8141770c} Obtained from: ElectroBSD --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index 1a55d5ceca01..5e80d2c93439 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -6203,7 +6203,7 @@ arc_init(void) arc_c_max = (arc_c * 8) - (1 << 30); else arc_c_max = arc_c_min; - arc_c_max = MAX(arc_c * 5, arc_c_max); + arc_c_max = MAX(arc_c * 4, arc_c_max); /* * In userland, there's only the memory pressure that we artificially -- 2.11.0