kernel - VM rework part 2 - Replace backing_object with backing_ba
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 9 May 2019 02:39:44 +0000 (19:39 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 May 2019 16:24:45 +0000 (09:24 -0700)
commit9de48ead48581d5b505ed595b3649170741605cb
tree2c2b7233d1326a6026c4b11a2a135dbc11254504
parent6f76a56d4f467f3727b96d9d6741fa17703a02c9
kernel - VM rework part 2 - Replace backing_object with backing_ba

* Remove the vm_object based backing_object chains and all related
  chaining code.

  This removes an enormous number of locks from the VM system and
  also removes object-to-object dependencies which requires careful
  traversal code.  A great deal of complex code has been removed
  and replaced with far simpler code.

  Ultimately the intention will be to support removal of pv_entry
  tracking from vm_pages to gain lockless shared faults, but that
  is far in the future.  It will require hanging vm_map_backing
  structures off of a list based in the object.

* Implement the vm_map_backing structure which is embedded in the
  vm_map_entry and then links to additional dynamically allocated
  vm_map_backing structures via entry->ba.backing_ba.  This structure
  contains the object and offset and essentially takes over the
  functionality that object->backing_object used to have.

  backing objects are now handled via vm_map_backing.  In this
  commit, fork operations create a fan-in tree to shared subsets
  of backings via vm_map_backing.  In this particular commit,
  these subsets are not collapsed in any way.

* Remove all the vm_map_split and collapse code.  Every last line
  is gone.  It will be reimplemented using vm_map_backing in a
  later commit.

  This means that as-of this commit both recursive forks and
  parent-to-multiple-children forks cause an accumulation of
  inefficient lists of backing objects to occur in the parent
  and children.  This will begin to get addressed in part 3.

* The code no longer releases the vm_map lock (typically shared)
  across (get_pages) I/O.  There are no longer any chaining locks to
  get in the way (hopefully).  This means that the code does not
  have to re-check as carefully as it did before.  However, some
  complexity will have to be added back in once we begin to address
  the accumulation of vm_map_backing structures.

* Paging performance improved by 30-40%
18 files changed:
sys/kern/imgact_elf.c
sys/kern/sys_process.c
sys/kern/sysv_shm.c
sys/platform/pc64/x86_64/pmap.c
sys/platform/pc64/x86_64/trap.c
sys/vfs/procfs/procfs_map.c
sys/vm/swap_pager.c
sys/vm/swap_pager.h
sys/vm/vm_fault.c
sys/vm/vm_map.c
sys/vm/vm_map.h
sys/vm/vm_mmap.c
sys/vm/vm_object.c
sys/vm/vm_object.h
sys/vm/vm_swapcache.c
sys/vm/vnode_pager.c
sys/vm/vnode_pager.h
usr.bin/fstat/fstat.c