kernel - Fix swap issue, implement dynamic pmap PT/PD/PDP deletion
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 30 Dec 2016 20:21:26 +0000 (12:21 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 30 Dec 2016 20:21:26 +0000 (12:21 -0800)
commita7a03a5f23a9828719d348cb3c6c880d28003738
tree952739757e5dfd2a07d924f1623f1f541c147b5b
parent9e2a88e3721529c2b4883dc6ad5b8427273411d3
kernel - Fix swap issue, implement dynamic pmap PT/PD/PDP deletion

* The pmap code is now able to dynamically destroy PT, PD, and PDP
  page table pages when they become empty.  To do this we had to
  recode the higher-level page tables to wire on creation of a lower-level
  pv_entry instead of wiring on pte entry.

  DragonFly previously left PD and PDP pages intact, and possibly also PTs,
  until process exit.  In normal operation this had no real impact since
  most programs don't bloat up enough for the extra page table pages to
  matter, but its good to finally fix it as it allows the pmap footprint
  to be significantly reduced in the very few situations where a program
  bloats and unbloats during operation.

* Fix an issue with recent swap changes.  We must increase the stripe
  between multiple swap devices to match the number of entries available
  on a radix leaf, which increased from 32 to 64.  This fixes a pstat -s
  accounting error that would sometimes attribute swap frees to the wrong
  device.

* Refactor the RSS limiting code to scan the pmap instead of scan the
  vm_map and related underlying objects.  This greatly enhances performance
  because the underlying objects might have many pages that are not mapped.
  By scanning the pmap, we avoid having to sift through them all.

  Also makes use of the dynamic removal feature in the pmap code to restrict
  the effort required to do the pmap scan, and allows us to avoid most of
  the issues related to stacked VM objects.
sys/platform/pc64/x86_64/pmap.c
sys/platform/vkernel64/platform/pmap.c
sys/sys/dmap.h
sys/vm/pmap.h
sys/vm/swap_pager.c
sys/vm/swap_pager.h
sys/vm/vm_map.h
sys/vm/vm_pageout.c
sys/vm/vm_swap.c