diff options
author | Alan Cox <alc@FreeBSD.org> | 2015-12-19 18:42:50 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2015-12-19 18:42:50 +0000 |
commit | c869e672086f986a9f3aa1fe93fd2f0eb5c81156 (patch) | |
tree | 34a147bea7788aca2b0a5376368e87fce8afbfa1 /sys/vm/vm_page.h | |
parent | 2906f6cbae2e407ba2d1b5a81310c3f8ce5de32c (diff) | |
download | src-c869e672086f986a9f3aa1fe93fd2f0eb5c81156.tar.gz src-c869e672086f986a9f3aa1fe93fd2f0eb5c81156.zip |
Introduce a new mechanism for relocating virtual pages to a new physical
address and use this mechanism when:
1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical
memory allocator's free page lists. This replaces the long-standing
approach of scanning the inactive and inactive queues, converting clean
pages into PG_CACHED pages and laundering dirty pages. In contrast, the
new mechanism does not use PG_CACHED pages nor does it trigger a large
number of I/O operations.
2. on 32-bit MIPS processors, uma_small_alloc() and the pmap can't find
free pages in the physical memory allocator's free page lists that are
covered by the direct map. Tested by: adrian
3. ttm_bo_global_init() and ttm_vm_page_alloc_dma32() can't find suitable
free pages in the physical memory allocator's free page lists.
In the coming months, I expect that this new mechanism will be applied in
other places. For example, balloon drivers should use relocation to
minimize fragmentation of the guest physical address space.
Make vm_phys_alloc_contig() a little smarter (and more efficient in some
cases). Specifically, use vm_phys_segs[] earlier to avoid scanning free
page lists that can't possibly contain suitable pages.
Reviewed by: kib, markj
Glanced at: jhb
Discussed with: jeff
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4444
Notes
Notes:
svn path=/head/; revision=292469
Diffstat (limited to 'sys/vm/vm_page.h')
-rw-r--r-- | sys/vm/vm_page.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index a1f6fc405681..972603a04b98 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -474,6 +474,8 @@ vm_page_t vm_page_prev(vm_page_t m); boolean_t vm_page_ps_is_valid(vm_page_t m); void vm_page_putfake(vm_page_t m); void vm_page_readahead_finish(vm_page_t m); +bool vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary); void vm_page_reference(vm_page_t m); void vm_page_remove (vm_page_t); int vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); @@ -482,6 +484,8 @@ vm_page_t vm_page_replace(vm_page_t mnew, vm_object_t object, void vm_page_requeue(vm_page_t m); void vm_page_requeue_locked(vm_page_t m); int vm_page_sbusied(vm_page_t m); +vm_page_t vm_page_scan_contig(u_long npages, vm_page_t m_start, + vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options); void vm_page_set_valid_range(vm_page_t m, int base, int size); int vm_page_sleep_if_busy(vm_page_t m, const char *msg); vm_offset_t vm_page_startup(vm_offset_t vaddr); |