Changeset View
Changeset View
Standalone View
Standalone View
vm/vm_reserv.c
Context not available. | |||||
} | } | ||||
/* | /* | ||||
* Returns either the level of the reservation containing the given page or -1 | |||||
* if the page is not contained by a reservation. | |||||
*/ | |||||
int | |||||
vm_reserv_level(vm_page_t m) | |||||
{ | |||||
vm_reserv_t rv; | |||||
rv = vm_reserv_from_page(m); | |||||
return (rv->object != NULL ? 0 : -1); | |||||
} | |||||
/* | |||||
* Returns a reservation level if the given page belongs to a fully-populated | * Returns a reservation level if the given page belongs to a fully-populated | ||||
* reservation and -1 otherwise. | * reservation and -1 otherwise. | ||||
*/ | */ | ||||
Context not available. | |||||
} | } | ||||
/* | /* | ||||
* XXX | |||||
*/ | |||||
boolean_t | |||||
vm_reserv_reclaim_ifpartpop(vm_page_t m) | |||||
{ | |||||
vm_reserv_t rv; | |||||
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); | |||||
rv = vm_reserv_from_page(m); | |||||
if (rv->object != NULL && rv->inpartpopq) { | |||||
vm_reserv_reclaim(rv); | |||||
return (TRUE); | |||||
} else | |||||
return (FALSE); | |||||
} | |||||
/* | |||||
* Breaks the reservation at the head of the partially-populated reservation | * Breaks the reservation at the head of the partially-populated reservation | ||||
* queue, releasing its cached and free pages to the physical memory | * queue, releasing its cached and free pages to the physical memory | ||||
* allocator. Returns TRUE if a reservation is broken and FALSE otherwise. | * allocator. Returns TRUE if a reservation is broken and FALSE otherwise. | ||||
Context not available. | |||||
} | } | ||||
/* | /* | ||||
* Returns the size (in bytes) of a reservation of the specified level. | |||||
*/ | |||||
int | |||||
vm_reserv_size(int level) | |||||
{ | |||||
switch (level) { | |||||
case 0: | |||||
return (VM_LEVEL_0_SIZE); | |||||
case -1: | |||||
return (PAGE_SIZE); | |||||
default: | |||||
return (0); | |||||
} | |||||
} | |||||
/* | |||||
* Allocates the virtual and physical memory required by the reservation | * Allocates the virtual and physical memory required by the reservation | ||||
* management system's data structures, in particular, the reservation array. | * management system's data structures, in particular, the reservation array. | ||||
*/ | */ | ||||
Context not available. |