Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_mmap.c
Show First 20 Lines • Show All 887 Lines • ▼ Show 20 Lines | retry: | ||||
vm_page_unlock(m); | vm_page_unlock(m); | ||||
if (!locked) { | if (!locked) { | ||||
VM_OBJECT_WLOCK(object); | VM_OBJECT_WLOCK(object); | ||||
vm_page_lock(m); | vm_page_lock(m); | ||||
goto retry; | goto retry; | ||||
} | } | ||||
} else | } else | ||||
vm_page_unlock(m); | vm_page_unlock(m); | ||||
KASSERT(m->valid == VM_PAGE_BITS_ALL, | KASSERT(vm_page_all_valid(m), | ||||
("mincore: page %p is mapped but invalid", | ("mincore: page %p is mapped but invalid", | ||||
m)); | m)); | ||||
} else if (mincoreinfo == 0) { | } else if (mincoreinfo == 0) { | ||||
/* | /* | ||||
* The page is not mapped by this process. If | * The page is not mapped by this process. If | ||||
* the object implements managed pages, then | * the object implements managed pages, then | ||||
* determine if the page is resident so that | * determine if the page is resident so that | ||||
* the mappings might be examined. | * the mappings might be examined. | ||||
*/ | */ | ||||
if (current->object.vm_object != object) { | if (current->object.vm_object != object) { | ||||
if (object != NULL) | if (object != NULL) | ||||
VM_OBJECT_WUNLOCK(object); | VM_OBJECT_WUNLOCK(object); | ||||
object = current->object.vm_object; | object = current->object.vm_object; | ||||
VM_OBJECT_WLOCK(object); | VM_OBJECT_WLOCK(object); | ||||
} | } | ||||
if (object->type == OBJT_DEFAULT || | if (object->type == OBJT_DEFAULT || | ||||
object->type == OBJT_SWAP || | object->type == OBJT_SWAP || | ||||
object->type == OBJT_VNODE) { | object->type == OBJT_VNODE) { | ||||
pindex = OFF_TO_IDX(current->offset + | pindex = OFF_TO_IDX(current->offset + | ||||
(addr - current->start)); | (addr - current->start)); | ||||
m = vm_page_lookup(object, pindex); | m = vm_page_lookup(object, pindex); | ||||
if (m != NULL && m->valid == 0) | if (m != NULL && vm_page_none_valid(m)) | ||||
m = NULL; | m = NULL; | ||||
if (m != NULL) | if (m != NULL) | ||||
mincoreinfo = MINCORE_INCORE; | mincoreinfo = MINCORE_INCORE; | ||||
} | } | ||||
} | } | ||||
if (m != NULL) { | if (m != NULL) { | ||||
/* Examine other mappings to the page. */ | /* Examine other mappings to the page. */ | ||||
if (m->dirty == 0 && pmap_is_modified(m)) | if (m->dirty == 0 && pmap_is_modified(m)) | ||||
▲ Show 20 Lines • Show All 721 Lines • Show Last 20 Lines |