Changeset View
Changeset View
Standalone View
Standalone View
vm/vm_reserv.c
Show First 20 Lines • Show All 709 Lines • ▼ Show 20 Lines | vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex, int domain, | ||||
rv = vm_reserv_from_page(m); | rv = vm_reserv_from_page(m); | ||||
KASSERT(rv->pages == m, | KASSERT(rv->pages == m, | ||||
("vm_reserv_alloc_page: reserv %p's pages is corrupted", rv)); | ("vm_reserv_alloc_page: reserv %p's pages is corrupted", rv)); | ||||
KASSERT(rv->object == NULL, | KASSERT(rv->object == NULL, | ||||
("vm_reserv_alloc_page: reserv %p isn't free", rv)); | ("vm_reserv_alloc_page: reserv %p isn't free", rv)); | ||||
LIST_INSERT_HEAD(&object->rvq, rv, objq); | LIST_INSERT_HEAD(&object->rvq, rv, objq); | ||||
rv->object = object; | rv->object = object; | ||||
rv->pindex = first; | rv->pindex = first; | ||||
rv->domain = vm_phys_domidx(m); | rv->domain = domain; | ||||
markj: The changes in this function should also be made in vm_reserv_alloc_contig(). | |||||
alcUnsubmitted Not Done Inline ActionsThis assignment makes no sense. vm_reserv's are like vm_page's. They are permanently bound to a range of physical addresses. This field, if it exists at all, should be initialized at startup and never changed. alc: This assignment makes no sense. vm_reserv's are like vm_page's. They are permanently bound to… | |||||
KASSERT(rv->popcnt == 0, | KASSERT(rv->popcnt == 0, | ||||
("vm_reserv_alloc_page: reserv %p's popcnt is corrupted", rv)); | ("vm_reserv_alloc_page: reserv %p's popcnt is corrupted", rv)); | ||||
KASSERT(!rv->inpartpopq, | KASSERT(!rv->inpartpopq, | ||||
("vm_reserv_alloc_page: reserv %p's inpartpopq is TRUE", rv)); | ("vm_reserv_alloc_page: reserv %p's inpartpopq is TRUE", rv)); | ||||
for (i = 0; i < NPOPMAP; i++) | for (i = 0; i < NPOPMAP; i++) | ||||
KASSERT(rv->popmap[i] == 0, | KASSERT(rv->popmap[i] == 0, | ||||
("vm_reserv_alloc_page: reserv %p's popmap is corrupted", | ("vm_reserv_alloc_page: reserv %p's popmap is corrupted", | ||||
rv)); | rv)); | ||||
index = VM_RESERV_INDEX(object, pindex); | index = VM_RESERV_INDEX(object, pindex); | ||||
vm_reserv_populate(rv, index); | vm_reserv_populate(rv, index); | ||||
return (&rv->pages[index]); | return (&rv->pages[index]); | ||||
/* | /* | ||||
* Found a matching reservation. | * Found a matching reservation. | ||||
*/ | */ | ||||
found: | found: | ||||
index = VM_RESERV_INDEX(object, pindex); | index = VM_RESERV_INDEX(object, pindex); | ||||
m = &rv->pages[index]; | m = &rv->pages[index]; | ||||
KASSERT(object != kernel_object || vm_phys_domidx(m) == domain, | |||||
("vm_reserv_alloc_page: Domain mismatch from reservation.")); | |||||
/* Handle vm_page_rename(m, new_object, ...). */ | /* Handle vm_page_rename(m, new_object, ...). */ | ||||
if (popmap_is_set(rv->popmap, index)) | if (popmap_is_set(rv->popmap, index)) | ||||
return (NULL); | return (NULL); | ||||
vm_reserv_populate(rv, index); | vm_reserv_populate(rv, index); | ||||
return (m); | return (m); | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines |
The changes in this function should also be made in vm_reserv_alloc_contig().