git: kernel - Implement a contiguous memory reserve for contigma

看板DFBSD_commit作者時間14年前 (2011/11/19 13:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 79d182b0d3dee841326d364c0e92e46c405765e6 Author: Matthew Dillon <dillon@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
文章代碼(AID): #1EnpzM7A (DFBSD_commit)