git: kernel - Implement a contiguous memory reserve for contigmalloc()
dillon at crater.dragonflybsd.org
Fri Nov 18 21:08:39 PST 2011
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
* 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
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(-)
DragonFly BSD source repository
More information about the Commits