Refactor ZFS ARC reclaim logic to be more VM cooperative
authorsmh <smh@FreeBSD.org>
Thu, 28 Aug 2014 19:50:08 +0000 (19:50 +0000)
committersmh <smh@FreeBSD.org>
Thu, 28 Aug 2014 19:50:08 +0000 (19:50 +0000)
commit502601a54088ae2edc419343befadcf273f55be7
tree9abeeb2e900c80d094a4f19161a333f80421da73
parent8c55516430a89f2500e80c0dc69abf9b1594f38e
Refactor ZFS ARC reclaim logic to be more VM cooperative

Prior to this change we triggered ARC reclaim when kmem usage passed 3/4
of the total available, as indicated by vmem_size(kmem_arena, VMEM_ALLOC).

This could lead large amounts of unused RAM e.g. on a 192GB machine with
ARC the only major RAM consumer, 40GB of RAM would remain unused.

The old method has also been seen to result in extreme RAM usage under
certain loads, causing poor performance and stalls.

We now trigger ARC reclaim when the number of free pages drops below the
value defined by the new sysctl vfs.zfs.arc_free_target, which defaults
to the value of vm.v_free_target.

Credit to Karl Denninger for the original patch on which this update was
based.

PR: 191510 and 187594
Tested by: dteske
MFC after: 1 week
Relnotes: yes
Sponsored by: Multiplay
sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c
sys/cddl/compat/opensolaris/sys/kmem.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
sys/vm/vm_pageout.c