kernel - SWAP CACHE part 12/many - Add swapcache cleanup state
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 6 Feb 2010 16:57:05 +0000 (08:57 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 6 Feb 2010 16:57:05 +0000 (08:57 -0800)
commit00a3fdca11527a9e70b79270e03d979267907ca4
treeec73aa94652ae71ff390510b878ca2a982907b73
parentb9a09edee8fcb479c571cc3c8778211ebb64fb73
kernel - SWAP CACHE part 12/many - Add swapcache cleanup state

* Add a small state machine and hysteresis to flip between swapcache
  writing and swapcache cleaning.  The swapcache is written to until
  (unless) it hits 75% use.  If this occurs it switches to cleaning
  mode to get rid of swapcache pages until it gets down to 70%.  While
  in cleaning mode burst accumulation still occurs.  Then it flips back.

  Currently the cleaning mode tries to choose swap meta-blocks which
  are wholely swapped (have no VM pages), running linearly through
  the VM object list in order to try to clean contiguous areas of
  the swapcache.  The idea is to reduce fragmentation that would lead
  to excessive disk seeking.  At the same time the limited cleaning
  run (only 5% of the swap cache) should prevent any large-scale
  excessive deletion of the swapcache.

* Add a new VM object type, OBJT_MARKER, which may be used by iterators
  running through the vm_object_list.
sys/emulation/linux/i386/linprocfs/linprocfs_misc.c
sys/emulation/linux/linux_misc.c
sys/vm/swap_pager.c
sys/vm/swap_pager.h
sys/vm/vm_meter.c
sys/vm/vm_object.c
sys/vm/vm_object.h
sys/vm/vm_swapcache.c