summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2011-12-05 18:29:25 +0000
committeralc <alc@FreeBSD.org>2011-12-05 18:29:25 +0000
commita8855af4c0d2c4374763f3e58b930b60da8a1fa4 (patch)
tree169ae815456d0b52e73adc8ac35eff5e095e269b /sys/vm/vm_page.c
parentf47c7431dec003c1c26fce8811c39d1b1db72967 (diff)
downloadFreeBSD-src-a8855af4c0d2c4374763f3e58b930b60da8a1fa4.zip
FreeBSD-src-a8855af4c0d2c4374763f3e58b930b60da8a1fa4.tar.gz
Introduce vm_reserv_alloc_contig() and teach vm_page_alloc_contig() how to
use superpage reservations. So, for the first time, kernel virtual memory that is allocated by contigmalloc(), kmem_alloc_attr(), and kmem_alloc_contig() can be promoted to superpages. In fact, even a series of small contigmalloc() allocations may collectively result in a promoted superpage. Eliminate some duplication of code in vm_reserv_alloc_page(). Change the type of vm_reserv_reclaim_contig()'s first parameter in order that it be consistent with other vm_*_contig() functions. Tested by: marius (sparc64)
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 405bf25..ee4f2a4 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1554,9 +1554,12 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req,
cnt.v_free_count + cnt.v_cache_count >= npages)) {
#if VM_NRESERVLEVEL > 0
retry:
+ if (object == NULL || (object->flags & OBJ_COLORED) == 0 ||
+ (m_ret = vm_reserv_alloc_contig(object, pindex, npages,
+ low, high, alignment, boundary)) == NULL)
#endif
- m_ret = vm_phys_alloc_contig(npages, low, high, alignment,
- boundary);
+ m_ret = vm_phys_alloc_contig(npages, low, high,
+ alignment, boundary);
} else {
mtx_unlock(&vm_page_queue_free_mtx);
atomic_add_int(&vm_pageout_deficit, npages);
@@ -1581,8 +1584,8 @@ retry:
}
else {
#if VM_NRESERVLEVEL > 0
- if (vm_reserv_reclaim_contig(npages << PAGE_SHIFT, low, high,
- alignment, boundary))
+ if (vm_reserv_reclaim_contig(npages, low, high, alignment,
+ boundary))
goto retry;
#endif
}
OpenPOWER on IntegriCloud