git: kernel - VM rework part 2 - Replace backing_object with backing_ba

Matthew Dillon dillon at
Fri May 10 09:26:42 PDT 2019

commit 9de48ead48581d5b505ed595b3649170741605cb
Author: Matthew Dillon <dillon at>
Date:   Wed May 8 19:39:44 2019 -0700

    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%

Summary of changes:
 sys/kern/imgact_elf.c           |   48 +-
 sys/kern/sys_process.c          |   16 +-
 sys/kern/sysv_shm.c             |    1 -
 sys/platform/pc64/x86_64/pmap.c |   10 +-
 sys/platform/pc64/x86_64/trap.c |   17 +-
 sys/vfs/procfs/procfs_map.c     |   57 +-
 sys/vm/swap_pager.c             |   11 +
 sys/vm/swap_pager.h             |    1 +
 sys/vm/vm_fault.c               |  804 ++++++++++++----------
 sys/vm/vm_map.c                 |  810 ++++++++++------------
 sys/vm/vm_map.h                 |   74 +-
 sys/vm/vm_mmap.c                |   12 +-
 sys/vm/vm_object.c              | 1454 +++------------------------------------
 sys/vm/vm_object.h              |   48 +-
 sys/vm/vm_swapcache.c           |   53 +-
 sys/vm/vnode_pager.c            |   45 +-
 sys/vm/vnode_pager.h            |    4 +-
 usr.bin/fstat/fstat.c           |   27 +-
 18 files changed, 1114 insertions(+), 2378 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list