kernel - Fix swap-full process killer
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 30 Apr 2015 17:25:27 +0000 (10:25 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 30 Apr 2015 17:25:27 +0000 (10:25 -0700)
commit09eff54480fb055069cd958cd5e25bfb797425a8
treefd479473bee97cc9b3c0c129601cec12bdd4c614
parent06638ac6fd1ff90a5316f4c00bc659935d5b7f98
kernel - Fix swap-full process killer

* Previously once swap became full the kernel could enter a dead zone where
  no new pagouts are possible but there is just barely sufficient memory for
  the system to run.  That is, the minimum free page target is met but the
  pageout target cannot be met.

  This caused a 2+ second stall in the VM system followed by a 1 second
  run (where the pageout demon stops trying for 1 second before trying again),
  making the system unusable anyway.

* Replace that code.  Now we start killing processes once swap becomes full
  and we are unable to reach our paging target.  That is, we require that the
  pageout demon MUST be able to reach its paging target for free pages for
  the system to run well, even if there are barely sufficient pages to run
  the current steady state.

* Total anonymous (pageable) memory is still effectively RAM + SWAP.  It's
  just slightly less than it was before because it requires the free page
  target to be met and not just the free page minimum.

Reported-by: marino
sys/vm/swap_pager.c
sys/vm/swap_pager.h
sys/vm/vm_pageout.c
sys/vm/vm_swap.c