git: kernel - Implement a contiguous memory reserve for contigmalloc()

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Nov 18 21:08:39 PST 2011


commit 79d182b0d3dee841326d364c0e92e46c405765e6
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Nov 18 21:04:00 2011 -0800

    kernel - Implement a contiguous memory reserve for contigmalloc()
    
    * We initially reserve the lower 1/4 of memory or 256MB, whichever is
      smaller.  The ALIST API is used to manage the memory.
    
    * Once device initialization is complete, and before int is executed,
      we reduce the reserve and return pages to the normal VM paging queues.
      The reserve is reduced to ~16MB or 1/16 total memory, whichever is
      smaller.
    
    * This can be adjusted with a tunable 'vm.dma_reserved'.
    
    * contigmalloc() now tries the DMA reserve first.  If it fails it falls
      back to the original contigmalloc() code.  contigfree() determines whether
      the pages belong to the DMA reserve or not and will either return them
      to the reserve or free them to the normal paging queues as appropriate.
    
      VM pages in the reserve are left wired and not busy, and they are returned
      to the reserve in the same state.  This greatly simplifies operations that
      act on the reserve.
    
    * Fix various bits of code that contigmalloc()'d but then kfree()'d instead
      of contigfree()'d.

Summary of changes:
 sys/dev/disk/ncr/ncr.c             |    4 +-
 sys/dev/raid/dpt/dpt_scsi.c        |   18 ++-
 sys/platform/pc32/i386/machdep.c   |    5 +-
 sys/platform/pc64/x86_64/machdep.c |    5 +-
 sys/sys/vmmeter.h                  |    3 +
 sys/vm/vm_contig.c                 |  130 ++++++++-----------
 sys/vm/vm_extern.h                 |    2 +-
 sys/vm/vm_page.c                   |  244 ++++++++++++++++++++++++++++++++++--
 sys/vm/vm_page.h                   |   13 ++-
 9 files changed, 321 insertions(+), 103 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/79d182b0d3dee841326d364c0e92e46c405765e6


-- 
DragonFly BSD source repository





More information about the Commits mailing list