kernel - Fix a major (pageable) memory leak
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 30 Dec 2014 00:56:23 +0000 (16:56 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 30 Dec 2014 00:56:23 +0000 (16:56 -0800)
commit15553805ce5caf2e101c881cba99393893fab921
treefa9df62ab7fa3ccb5fb2097d8c82dbf5fe678e85
parent0b1d30622611fae46facc49bc1aca91f7b3fdf7f
kernel - Fix a major (pageable) memory leak

* Under certain relatively easy to reproduce conditions an extra ref_count
  can be added to a VM object during a fork(), preventing the object from
  ever being destroyed.  It's pages may even be paged out, but the system
  will eventually run out of swap space too.

* The actual fix is to assign 'map_object = object' in vm_map_insert()
  (see the diff).  The rest of this commit is conditionalized debugging
  code and code documentation.

* Because this change implements a relatively esoteric feature in the VM
  system by allowing an anonymous VM object to be extended to cover an
  area even though it might have a gap (so a new VM object does not have
  to be allocated), further testing is needed before we can MFC this to
  the RELEASE branch.
sys/vm/vm_map.c
sys/vm/vm_object.c
sys/vm/vm_object.h