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

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Nov 7 11:47:41 PST 2013


commit c2f95d8a2185be01498f8b94a1cd429fbd520d45
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/c2f95d8a2185be01498f8b94a1cd429fbd520d45


-- 
DragonFly BSD source repository



More information about the Commits mailing list