kernel - Replace global vmobj_token with vmobj_tokens[] array
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 25 Oct 2013 00:01:28 +0000 (17:01 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 25 Oct 2013 00:01:28 +0000 (17:01 -0700)
commit7b00fbb4c0ce96d5b7130b22da7d0f9b06084e06
tree579dfa63b2742e6f648f4195da9f34d600b5073e
parent519883f3e095f25c73785ed449b354f237649f7b
kernel - Replace global vmobj_token with vmobj_tokens[] array

* Remove one of the two remaining major bottlenecks in the system, the
  global vmobj_token which is used to manage access to the vm_object_list.
  All VM object creation and deletion would get thrown into this list.

* Replace it with an array of 64 tokens and an array of 64 lists.
  vmobj_token[] and vm_object_lists[].  Use a simple right-shift
  hash code to index the array.

* This reduces contention by a factor of 64 or so which makes a big
  difference on multi-chip cpu systems.  It won't be as noticable on
  single-chip (e.g. 4-core/8-thread) systems.

* Rip-out some of the linux vmstats compat functions which were iterating
  the object list and replace with the pcpu accumulator scan that was
  recently implemented for dragonfly vmstats.

* TODO: proc_token.
sys/emulation/linux/i386/linprocfs/linprocfs_misc.c
sys/emulation/linux/linux_misc.c
sys/gnu/vfs/ext2fs/ext2_vfsops.c
sys/kern/lwkt_token.c
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c
sys/sys/thread.h
sys/vm/swap_pager.c
sys/vm/vm_object.c
sys/vm/vm_object.h
sys/vm/vm_swapcache.c