kernel - Redo struct vmspace allocator and ref-count handling.
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 23 Jul 2014 01:52:47 +0000 (18:52 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 23 Jul 2014 01:52:47 +0000 (18:52 -0700)
commit93f86408bb378310ca0663f56f5873e7eef90704
tree75f83b2382412951cbfd8f28c210d8fa575ffad6
parente900a7a285d9d2b36032617049b6e05c8ebb7137
kernel - Redo struct vmspace allocator and ref-count handling.

* Get rid of the sysref-based allocator and ref-count handler and
  replace with objcache.  Replace all sysref API calls in other kernel
  modules with vmspace_*() API calls (adding new API calls as needed).

* Roll-our-own hopefully safer ref-count handling.  We get rid of exitingcnt
  and instead just leave holdcnt bumped during the exit/reap sequence.  We
  add vm_refcnt and redo vm_holdcnt.

  Now a formal reference (vm_refcnt) is ALSO covered by a holdcnt.  Stage-1
  termination occurs when vm_refcnt transitions from 1->0.  Stage-2 termination
  occurs when vm_holdcnt transitions from 1->0.

* Should fix rare reported panic under heavy load.
18 files changed:
sys/kern/imgact_resident.c
sys/kern/init_main.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_kinfo.c
sys/kern/tty.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc64/vmm/vmx.c
sys/platform/pc64/x86_64/pmap.c
sys/platform/vkernel/platform/pmap.c
sys/platform/vkernel64/platform/pmap.c
sys/vfs/procfs/procfs_mem.c
sys/vm/vm_extern.h
sys/vm/vm_glue.c
sys/vm/vm_map.c
sys/vm/vm_map.h
sys/vm/vm_mmap.c
sys/vm/vm_vmspace.c