kernel - Adjust KVA use on i386 and x86_64
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 29 Sep 2010 18:38:30 +0000 (11:38 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 29 Sep 2010 18:38:30 +0000 (11:38 -0700)
commit948209ced623a677639255d06b6a8470f3605b27
tree827f3f7dc99ff9b43fd6a325cd3ac965dc3f924f
parent7a52e261d58c007ae4615e067eac8d99a902cd19
kernel - Adjust KVA use on i386 and x86_64

The i386 changes recover another ~60MB of KVM for kernel use.  This is an
attempt to further reduce KVM use based on bug reports from people running
production systems.

The x86_64 changes recognize the now much-larger KVM space (128G+) and
remove some i386-era limitations.

* i386 - Reduce the nominal maximum swbufs on i386 from 256 to 128,
  saving 16MB of KVM (and also 16MB of real memory).

  Now that we have swbufs both with and without kva we don't really
  need so many with kva.

* i386 - Reduce pv_entry reservation on machines with maximal memory
  configurations from 2.5-3M entries down to 1.4M entries.

  In addition to fixing a bug which counted vm_page_array_size twice
  (which is also fixed on x86_64 in this commit), also put a soft cap
  of 1.4M pv entries.  Most production machines never even get close
  to the old cap and this saves us at least 45MB of KVM on machines
  with 3G+ of ram.

  The cap can be raised with a kenv boot variable (vm.pmap.pv_entries).

* x86_64 - Increase the maximum buffer cache size from 400MB to 1GB.
  This will effect machines with >4G of ram.  A machine with 8G of
  ram will wind up with ~800MB worth of buffer cache.

  In particular this should improve HAMMER's cache performance since
  the presence of a cache bp is needed to circumvent the per-mount
  lock.  This may also improve flushes but it is hard to say.

Reported-by: Peter Avalos <peter@theshell.com>
sys/cpu/x86_64/include/param.h
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc64/x86_64/pmap.c