kernel - simplify vm pager ops, add pre-faulting for zero-fill pages.
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 18 Jan 2010 01:27:50 +0000 (17:27 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 18 Jan 2010 01:52:51 +0000 (17:52 -0800)
commit1b9d3514e66df9d4bc5a25c898c7c8cbe414e3e4
treec6a17f071efab285065fbf9b2471bb4a1f864114
parent82d1ed25dd0260190823a69517b17901d529b14a
kernel - simplify vm pager ops, add pre-faulting for zero-fill pages.

* Remove the behind and ahead arguments to struct pagerops->pgo_getpages,
  and pagerops->pgo_haspage.

  Adjust pgo_getpages() to pgo_getpage(), change *_pager_getpages() to
  *_pager_getpage(), etc.  Add a sequential access flag to the call.

  The VM system is no longer responsible for dealing with read-ahead on
  pager ops.  The individual pagers are now responsible.

  The vnode pager now specifies the sequential access heuristic based on
  the hint passed to it.  HAMMER uses this hint to issue readaheads via
  the buffer cache.

* Move, rename, and consolidate pmap_prefault().  Remove this function
  from all platform sources and place it in vm/vm_fault.c.  Add a
  simple platform-specific pmap_prefault_ok() function to test particular
  virtual addresses.

* The new prefault code is called vm_prefault().  Enhance the code to
  also prefault and make writable (when it can) zero-fill pages.

  The new zero-fill prefault feature improves buildworld times by
  over 5% by greatly reducing the number of VM faults taken during
  normal program operation.  This particularly helps larger applications
  and concurrent applications in SMP systems.

  The code is conditionalized such that small applications (which do not
  benefit much from prefaulting zero-fill) still run about as fast as
  they did before.

* Fix an issue in vm_fault() where the vm_map was being unlocked before
  the prefault code was called when it really needs to be unlocked
  after the prefault code is called.
19 files changed:
sys/kern/kern_exec.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/i386/trap.c
sys/platform/pc64/x86_64/pmap.c
sys/platform/pc64/x86_64/trap.c
sys/platform/vkernel/i386/trap.c
sys/platform/vkernel/platform/pmap.c
sys/vm/default_pager.c
sys/vm/device_pager.c
sys/vm/phys_pager.c
sys/vm/pmap.h
sys/vm/swap_pager.c
sys/vm/swap_pager.h
sys/vm/vm_fault.c
sys/vm/vm_map.h
sys/vm/vm_object.c
sys/vm/vm_pager.c
sys/vm/vm_pager.h
sys/vm/vnode_pager.c