Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.c
Show First 20 Lines • Show All 1,365 Lines • ▼ Show 20 Lines | |||||
* This is intended to be used when reading a page from backing store fails. | * This is intended to be used when reading a page from backing store fails. | ||||
*/ | */ | ||||
void | void | ||||
vm_page_free_invalid(vm_page_t m) | vm_page_free_invalid(vm_page_t m) | ||||
{ | { | ||||
KASSERT(vm_page_none_valid(m), ("page %p is valid", m)); | KASSERT(vm_page_none_valid(m), ("page %p is valid", m)); | ||||
KASSERT(!pmap_page_is_mapped(m), ("page %p is mapped", m)); | KASSERT(!pmap_page_is_mapped(m), ("page %p is mapped", m)); | ||||
vm_page_assert_xbusied(m); | |||||
KASSERT(m->object != NULL, ("page %p has no object", m)); | KASSERT(m->object != NULL, ("page %p has no object", m)); | ||||
VM_OBJECT_ASSERT_WLOCKED(m->object); | VM_OBJECT_ASSERT_WLOCKED(m->object); | ||||
vm_page_xbusy_claim(m); | |||||
kib: I think a comment would be useful saying that the function is used in contexts where the page… | |||||
/* | /* | ||||
* If someone has wired this page while the object lock | * If someone has wired this page while the object lock | ||||
* was not held, then the thread that unwires is responsible | * was not held, then the thread that unwires is responsible | ||||
* for freeing the page. Otherwise just free the page now. | * for freeing the page. Otherwise just free the page now. | ||||
* The wire count of this unmapped page cannot change while | * The wire count of this unmapped page cannot change while | ||||
* we have the page xbusy and the page's object wlocked. | * we have the page xbusy and the page's object wlocked. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 4,125 Lines • Show Last 20 Lines |
I think a comment would be useful saying that the function is used in contexts where the page is xbusy but not owned by us, because we are typically io completion thread.