DragonFlyBSD/src 1c024bcsys/vm vm_fault.c vm_map.c

kernel - VM rework part 4 - Implement vm_fault_collapse()

* Add the function vm_fault_collapse().  This function simulates
  faults to copy all pages from backing objects into the front
  object, allowing the backing objects to be disconnected
  from the map entry.

  This function is called under certain conditions from the
  vmspace_fork*() code prior to a fork to potentially collapse
  the entry's backing objects into the front object.  The
  caller then disconnects the backing objects, truncating the
  list to a single object (the front object).

  This optimization is necessary to prevent the backing_ba list
  from growing in an unbounded fashion.  In addition, being able
  to disconnect the graph allows redundant backing store to
  be freed more quickly, reducing memory use.

* Add sysctl vm.map_backing_shadow_test (default enabled).
  The vmspace_fork*() code now does a quick all-shadowed test on
  the first backing object and calls vm_fault_collapse()
  if it comes back true, regardless of the chain length.

* Add sysctl vm.map_backing_limit (default 5).
  The vmspace_fork*() code calls vm_fault_collapse() when the
  ba.backing_ba list exceeds the specified number of entries.

* Performance is a tad faster than the original collapse
  code.
DeltaFile
+98-116sys/vm/vm_fault.c
+100-1sys/vm/vm_map.c
+1-0sys/vm/vm_extern.h
+1-0sys/vm/vm_object.h
+200-1174 files

UnifiedSplitRaw