Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_swapout.c
Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static void | static void | ||||
vm_swapout_map_deactivate_pages(vm_map_t map, long desired) | vm_swapout_map_deactivate_pages(vm_map_t map, long desired) | ||||
{ | { | ||||
vm_map_entry_t tmpe; | vm_map_entry_t tmpe; | ||||
vm_object_t obj, bigobj; | vm_object_t obj, bigobj; | ||||
int nothingwired; | int nothingwired; | ||||
if (!vm_map_trylock(map)) | if (!vm_map_trylock_read(map)) | ||||
return; | return; | ||||
bigobj = NULL; | bigobj = NULL; | ||||
nothingwired = TRUE; | nothingwired = TRUE; | ||||
/* | /* | ||||
* first, search out the biggest object, and try to free pages from | * first, search out the biggest object, and try to free pages from | ||||
* that. | * that. | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | vm_swapout_map_deactivate_pages(vm_map_t map, long desired) | ||||
* Remove all mappings if a process is swapped out, this will free page | * Remove all mappings if a process is swapped out, this will free page | ||||
* table pages. | * table pages. | ||||
*/ | */ | ||||
if (desired == 0 && nothingwired) { | if (desired == 0 && nothingwired) { | ||||
pmap_remove(vm_map_pmap(map), vm_map_min(map), | pmap_remove(vm_map_pmap(map), vm_map_min(map), | ||||
vm_map_max(map)); | vm_map_max(map)); | ||||
} | } | ||||
vm_map_unlock(map); | vm_map_unlock_read(map); | ||||
} | } | ||||
/* | /* | ||||
* Swap out requests | * Swap out requests | ||||
*/ | */ | ||||
#define VM_SWAP_NORMAL 1 | #define VM_SWAP_NORMAL 1 | ||||
#define VM_SWAP_IDLE 2 | #define VM_SWAP_IDLE 2 | ||||
▲ Show 20 Lines • Show All 639 Lines • Show Last 20 Lines |