Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.c
Show First 20 Lines • Show All 991 Lines • ▼ Show 20 Lines | |||||
static vm_page_t | static vm_page_t | ||||
vm_page_find_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, | vm_page_find_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, | ||||
vm_paddr_t high, u_long alignment, vm_paddr_t boundary) | vm_paddr_t high, u_long alignment, vm_paddr_t boundary) | ||||
{ | { | ||||
struct vm_domain *vmd; | struct vm_domain *vmd; | ||||
vm_page_t m_ret; | vm_page_t m_ret; | ||||
vmd = VM_DOMAIN(domain); | vmd = VM_DOMAIN(domain); | ||||
if (!vm_domain_allocate(vmd, req, npages)) | |||||
return (NULL); | |||||
#if VM_NRESERVLEVEL > 0 | #if VM_NRESERVLEVEL > 0 | ||||
again: | again: | ||||
#endif | #endif | ||||
if (!vm_domain_allocate(vmd, req, npages)) | |||||
return (NULL); | |||||
/* | /* | ||||
* Try to allocate the pages from the free page queues. | * Try to allocate the pages from the free page queues. | ||||
*/ | */ | ||||
vm_domain_free_lock(vmd); | vm_domain_free_lock(vmd); | ||||
m_ret = vm_phys_alloc_contig(domain, npages, low, high, | m_ret = vm_phys_alloc_contig(domain, npages, low, high, | ||||
alignment, boundary); | alignment, boundary); | ||||
vm_domain_free_unlock(vmd); | vm_domain_free_unlock(vmd); | ||||
if (m_ret != NULL) | if (m_ret != NULL) | ||||
Show All 34 Lines | |||||
("vm_page_alloc_contig: object %p has fictitious pages", | ("vm_page_alloc_contig: object %p has fictitious pages", | ||||
object)); | object)); | ||||
KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); | KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); | ||||
mpred = vm_radix_lookup_le(&object->rtree, pindex); | mpred = vm_radix_lookup_le(&object->rtree, pindex); | ||||
KASSERT(mpred == NULL || mpred->pindex != pindex, | KASSERT(mpred == NULL || mpred->pindex != pindex, | ||||
("vm_page_alloc_contig: pindex already allocated")); | ("vm_page_alloc_contig: pindex already allocated")); | ||||
/* | /* | ||||
* Can we allocate the pages without the number of free pages falling | * Can we allocate the pages without the number of free pages falling | ||||
* below the lower bound for the allocation class? | * below the lower bound for the allocation class? | ||||
*/ | */ | ||||
alc: This comment no longer makes sense here. It belongs before the call to vm_domain_allocate(). | |||||
for (;;) { | for (;;) { | ||||
#if VM_NRESERVLEVEL > 0 | #if VM_NRESERVLEVEL > 0 | ||||
/* | /* | ||||
* Can we allocate the pages from a reservation? | * Can we allocate the pages from a reservation? | ||||
*/ | */ | ||||
if (vm_object_reserv(object) && | if (vm_object_reserv(object) && | ||||
(m_ret = vm_reserv_alloc_contig(object, pindex, domain, req, | (m_ret = vm_reserv_alloc_contig(object, pindex, domain, req, | ||||
mpred, npages, low, high, alignment, boundary)) != NULL) { | mpred, npages, low, high, alignment, boundary)) != NULL) { | ||||
▲ Show 20 Lines • Show All 937 Lines • Show Last 20 Lines |
This comment no longer makes sense here. It belongs before the call to vm_domain_allocate().