freebsd-skq/sys/vm
Alexander Motin 2760658b21 Improve UMA cache reclamation.
When estimating working set size, measure only allocation batches, not free
batches.  Allocation and free patterns can be very different.  For example,
ZFS on vm_lowmem event can free to UMA few gigabytes of memory in one call,
but it does not mean it will request the same amount back that fast too, in
fact it won't.

Update working set size on every reclamation call, shrinking caches faster
under pressure.  Lack of this caused repeating vm_lowmem events squeezing
more and more memory out of real consumers only to make it stuck in UMA
caches.  I saw ZFS drop ARC size in half before previous algorithm after
periodic WSS update decided to reclaim UMA caches.

Introduce voluntary reclamation of UMA caches not used for a long time. For
each zdom track longterm minimal cache size watermark, freeing some unused
items every UMA_TIMEOUT after first 15 minutes without cache misses. Freed
memory can get better use by other consumers.  For example, ZFS won't grow
its ARC unless it see free memory, since it does not know it is not really
used.  And even if memory is not really needed, periodic free during
inactivity periods should reduce its fragmentation.

Reviewed by:	markj, jeff (previous version)
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D29790
2021-05-02 19:45:23 -04:00
..
_vm_phys.h
_vm_radix.h
default_pager.c
device_pager.c
memguard.c
memguard.h
phys_pager.c
pmap.h
redzone.c
redzone.h
sg_pager.c
swap_pager.c sysctl vm.objects: report backing object and swap use 2021-04-19 21:32:01 +03:00
swap_pager.h sysctl vm.objects: report backing object and swap use 2021-04-19 21:32:01 +03:00
uma_core.c Improve UMA cache reclamation. 2021-05-02 19:45:23 -04:00
uma_dbg.c
uma_dbg.h
uma_int.h Improve UMA cache reclamation. 2021-05-02 19:45:23 -04:00
uma.h uma: Introduce per-domain reclamation functions 2021-04-14 13:03:34 -04:00
vm_domainset.c
vm_domainset.h
vm_dumpset.h
vm_extern.h
vm_fault.c vm_fault: Shoot down multiply mapped COW source page mappings 2021-04-06 14:49:28 -04:00
vm_glue.c kstack: Add KASAN state transitions 2021-04-13 17:42:21 -04:00
vm_init.c
vm_kern.c uma: Introduce per-domain reclamation functions 2021-04-14 13:03:34 -04:00
vm_kern.h
vm_map.c
vm_map.h
vm_meter.c
vm_mmap.c
vm_object.c sysctl vm.objects: report backing object and swap use 2021-04-19 21:32:01 +03:00
vm_object.h
vm_page.c vm: Round up npages and alignment for contig reclamation 2021-03-02 10:21:02 -05:00
vm_page.h
vm_pageout.c
vm_pageout.h
vm_pagequeue.h
vm_pager.c
vm_pager.h
vm_param.h
vm_phys.c
vm_phys.h
vm_radix.c
vm_radix.h
vm_reserv.c vm_reserv: Fix list locking in vm_reserv_reclaim_contig() 2021-03-11 10:35:35 -05:00
vm_reserv.h
vm_swapout_dummy.c
vm_swapout.c
vm_unix.c
vm.h
vnode_pager.c Remove unused obj variable missed in r354870. 2021-03-17 15:29:15 -07:00
vnode_pager.h