Paging and swapping system fixes.
commit5f9f872bbbc6d37ce7f6ecc93d138fbd317f6f1b
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 28 Apr 2008 21:16:27 +0000 (28 21:16 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 28 Apr 2008 21:16:27 +0000 (28 21:16 +0000)
tree002624902fb0c32ea89285ff8c4e154bc414e91e
parentf5529b45d31ff47866c1ddddd1f1e3314dea1d64
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