kernel - more SMP optimizations in the VM system
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 24 Oct 2013 06:53:16 +0000 (23:53 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 24 Oct 2013 07:14:17 +0000 (00:14 -0700)
commit2734d278f143c02c9332df562f5b768835de13a4
tree59798d53a606e00aec6c649edcc76a0b07cdd82c
parent382f042f9bab3a435f6db01836965c41ea165721
kernel - more SMP optimizations in the VM system

* imgact_elf - drop the vm_object a little earlier in load_section(),
  and use a shared object lock when iterating ELF segments.

* When starting a vforked process use a shared process token to
  interlock the wait loop instead of an exclusive token.  Also don't
  bother with the token if there's nothing to wait for.

* When forking, pre-assign lp2 thread's td_ucred.

* Remove the vp->v_object load check loop.  It should not be possible
  for vp->v_object to change after being assigned as long as the vp
  is referenced.

* Replace most OBJ_DEAD tests with assertions that the flag is not set.

* Remove the VOLOCK/VOWANT vnode interlock.  It shouldn't be possible
  for the vnode's object to change while the vnode is ref'd.  This was
  a leftover from a long-ago time when vnodes were more persistent and
  could be recycled and race accessors.

  This also removes vm_object_dead_sleep/wait and related code.

* When memory mapping a vnode object there is no need to formally
  hold and chain_wait the object.  We can simply add a ref to it,
  because vnode objects cannot have backing chains.

* When deallocating a vm_object we can shortcut counts greater than 1
  for OBJT_VNODE objects instead of counts greater than 3.

* Optimize vnode_pager_alloc(), avoiding unnecessary locks.  Keep the
  temporary vnode token for the moment.

* Optimize vnode_pager_reference(), removing all locks from the path.
sys/kern/imgact_elf.c
sys/kern/kern_fork.c
sys/kern/vfs_subr.c
sys/sys/vnode.h
sys/vm/vm_map.c
sys/vm/vm_object.c
sys/vm/vm_object.h
sys/vm/vnode_pager.c