Paging and swapping system fixes.
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 28 Apr 2008 21:16:27 +0000 (21:16 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 28 Apr 2008 21:16:27 +0000 (21:16 +0000)
commit93afe6bea5b03eaae6a6ad66513ddacdcb4315d2
tree7f83e82ae3651d7d47db483c7132a93121bab3ec
parentc1bae230e3586d3c787f1396113ae842e1ede444
Paging and swapping system fixes.

* Do not try to free a VM page after a failed IO read from swap.  It is
  illegal to free a VM page from an interrupt.  Just deactivate it instead.

* Do not attempt to move a VM page into the cache queue after a successful
  pageout from the vnode or swap pagers, and do not try to adjust page
  protections to read-only (they should already be read-only).  Both
  operations require making serious pmap calls which we really do not
  want to do from an interrupt.

  Instead, leave the page on its current queue or, if the system is low
  on pages, deactivate the page.

The pmap protection code is supposed to be runnable from an interrupt but
testing with vkernels shows program corruption occuring under severe paging
loads.  Pmap protection changes were only being made from pageout interrupts.
brelse() itself, which can also be called from an interrupt via biodone(),
does not make such changes for asynchronous I/O.

With these changes in place the program corruption stopped or has been
greatly reduced.  Further testing in a 64MB vkernel environment is ongoing.

In addition, trying to move the page after a completed pageout/swappout
to the cache queue was improperly depressing the priority of read-heavy
pages.  Under severe paging loads we now only deactivate the page.  Plus
moving a page to the cache queue causes pmap operations to be run which
we again do not want to run from an interrupt.
sys/vm/swap_pager.c
sys/vm/vm_pageout.c
sys/vm/vnode_pager.c