git: kernel - Fix a major (pageable) memory leak

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Dec 29 17:08:32 PST 2014


commit 15553805ce5caf2e101c881cba99393893fab921
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Dec 29 16:56:23 2014 -0800

    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.

Summary of changes:
 sys/vm/vm_map.c    |  17 ++++
 sys/vm/vm_object.c | 259 ++++++++++++++++++++++++++++++-----------------------
 sys/vm/vm_object.h |  72 +++++++++------
 3 files changed, 208 insertions(+), 140 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/15553805ce5caf2e101c881cba99393893fab921


-- 
DragonFly BSD source repository



More information about the Commits mailing list