git: kernel - Work through some memory leaks in dsched

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Sep 23 17:22:55 PDT 2010


commit b5d7061d1ace7a0b0583af8ceae683dbd3e9bc81
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Sep 23 17:15:07 2010 -0700

    kernel - Work through some memory leaks in dsched
    
    * Add a uninitbufbio() function to complement initbufbio().  Also move
      BUF_LOCKINIT() into initbufbio() and BUF_LOCKFREE() into uninitbufbio().
    
    * There are several device drivers and other places where the struct buf
      is still being allocated manually (verses using getpbuf()).  These were
      kfree()ing the buffer without dealing with e.g. dsched_exit_buf().
    
      Have uninitbufbio() call dsched_exit_buf() and adjust the various manual
      allocations/frees of struct buf to call uninitbufbio() before kfree()ing.
      Also remove various manual calls to BUF_LOCKFREE() (which is now done
      inside uninitbufbio()).
    
    * This should hopefully deal with the memory leaks but there could be a
      few left.
    
    Reported-by: "Steve O'Hara-Smith" <steve at sohara.org>

Summary of changes:
 sys/dev/disk/ata/ata-raid.c         |   25 +++++++++++++++++--------
 sys/dev/disk/ccd/ccd.c              |    3 +--
 sys/dev/disk/nata/ata-raid.c        |    4 ++--
 sys/dev/raid/vinum/vinuminterrupt.c |    4 ++--
 sys/dev/raid/vinum/vinumrequest.c   |    8 +++-----
 sys/kern/kern_dsched.c              |    2 +-
 sys/kern/vfs_bio.c                  |   16 ++++++++++++++--
 sys/sys/buf.h                       |    1 +
 sys/vfs/devfs/devfs_vnops.c         |   19 ++++++++++---------
 9 files changed, 51 insertions(+), 31 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b5d7061d1ace7a0b0583af8ceae683dbd3e9bc81


-- 
DragonFly BSD source repository





More information about the Commits mailing list