git: DragonFly_RELEASE_3_6 kernel - Fix memory leak, clean up kernel slab fragmentation

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Nov 7 23:29:10 PST 2013


commit 21c324a6889464ae924865c96c2cefe057b6bf07
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Nov 7 11:21:12 2013 -0800

    kernel - Fix memory leak, clean up kernel slab fragmentation
    
    * The kernel slab allocator collects off-cpu kfree()s in z_RChunks.  This
      linked list is freed up by the owning cpu.  However, zones which are not
      at the head of the list can wind up with non-NULL z_RChunks which never
      get freed.
    
    * Add a 10-second callout on every cpu to clean-up these stale zones, giving
      the kernel a chance to free the related zones.
    
    * This was probably the cause for other kernel memory leaks reported in the
      past.
    
    Found-by: sephe

Summary of changes:
 sys/kern/kern_slaballoc.c | 145 +++++++++++++++++++++++++++++-----------------
 sys/kern/kern_timeout.c   |  22 +++++++
 sys/sys/malloc.h          |   1 +
 3 files changed, 116 insertions(+), 52 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/21c324a6889464ae924865c96c2cefe057b6bf07


-- 
DragonFly BSD source repository



More information about the Commits mailing list