Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.c
Show First 20 Lines • Show All 1,356 Lines • ▼ Show 20 Lines | vm_page_readahead_finish(vm_page_t m) | ||||
if ((m->busy_lock & VPB_BIT_WAITERS) != 0) | if ((m->busy_lock & VPB_BIT_WAITERS) != 0) | ||||
vm_page_activate(m); | vm_page_activate(m); | ||||
else | else | ||||
vm_page_deactivate(m); | vm_page_deactivate(m); | ||||
vm_page_xunbusy_unchecked(m); | vm_page_xunbusy_unchecked(m); | ||||
} | } | ||||
/* | /* | ||||
* Destroy the identity of invalid pages and free them if possible. | |||||
* This is intended to be used when reading pages from backing store fails. | |||||
*/ | |||||
void | |||||
vm_page_remove_invalid(vm_page_t m) | |||||
kib: I would call this vm_page_free_invalid() | |||||
{ | |||||
KASSERT(vm_page_none_valid(m), ("page %p is valid", m)); | |||||
KASSERT(!pmap_page_is_mapped(m), ("page %p is mapped", m)); | |||||
vm_page_assert_xbusied(m); | |||||
VM_OBJECT_ASSERT_WLOCKED(m->object); | |||||
kibUnsubmitted Not Done Inline ActionsI think it is that rare case when it is useful to assert that m->object != NULL. kib: I think it is that rare case when it is useful to assert that m->object != NULL. | |||||
/* | |||||
* If someone has wired this page while the object lock | |||||
* was not held, then the thread that unwires is responsible | |||||
* for freeing the page. Otherwise just free the page now. | |||||
* The wire count of this unmapped page cannot change while | |||||
* we have the page xbusy and the page's object wlocked. | |||||
*/ | |||||
if (vm_page_remove(m)) | |||||
vm_page_free(m); | |||||
} | |||||
/* | |||||
* vm_page_sleep_if_busy: | * vm_page_sleep_if_busy: | ||||
* | * | ||||
* Sleep and release the object lock if the page is busied. | * Sleep and release the object lock if the page is busied. | ||||
* Returns TRUE if the thread slept. | * Returns TRUE if the thread slept. | ||||
* | * | ||||
* The given page must be unlocked and object containing it must | * The given page must be unlocked and object containing it must | ||||
* be locked. | * be locked. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 4,096 Lines • Show Last 20 Lines |
I would call this vm_page_free_invalid()