Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_object.c
Show First 20 Lines • Show All 1,471 Lines • ▼ Show 20 Lines | for (; m != NULL && (idx = m->pindex - offidxstart) < size; | ||||
*/ | */ | ||||
if (vm_page_tryxbusy(m) == 0) { | if (vm_page_tryxbusy(m) == 0) { | ||||
VM_OBJECT_WUNLOCK(new_object); | VM_OBJECT_WUNLOCK(new_object); | ||||
vm_page_sleep_if_busy(m, "spltwt"); | vm_page_sleep_if_busy(m, "spltwt"); | ||||
VM_OBJECT_WLOCK(new_object); | VM_OBJECT_WLOCK(new_object); | ||||
goto retry; | goto retry; | ||||
} | } | ||||
/* | |||||
* The page was left invalid. Likely placed there by | |||||
* an incomplete fault. Just remove and ignore. | |||||
*/ | |||||
if (vm_page_none_valid(m)) { | |||||
if (vm_page_remove(m)) | |||||
vm_page_free(m); | |||||
else | |||||
vm_page_xunbusy(m); | |||||
continue; | |||||
} | |||||
/* vm_page_rename() will dirty the page. */ | /* vm_page_rename() will dirty the page. */ | ||||
if (vm_page_rename(m, new_object, idx)) { | if (vm_page_rename(m, new_object, idx)) { | ||||
vm_page_xunbusy(m); | vm_page_xunbusy(m); | ||||
VM_OBJECT_WUNLOCK(new_object); | VM_OBJECT_WUNLOCK(new_object); | ||||
VM_OBJECT_WUNLOCK(orig_object); | VM_OBJECT_WUNLOCK(orig_object); | ||||
vm_radix_wait(); | vm_radix_wait(); | ||||
VM_OBJECT_WLOCK(orig_object); | VM_OBJECT_WLOCK(orig_object); | ||||
VM_OBJECT_WLOCK(new_object); | VM_OBJECT_WLOCK(new_object); | ||||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | if (pp != NULL && vm_page_tryxbusy(pp) == 0) { | ||||
* unbusy the original (backing_obj) page before we can | * unbusy the original (backing_obj) page before we can | ||||
* (re)lock the parent. Hence we can get here. | * (re)lock the parent. Hence we can get here. | ||||
*/ | */ | ||||
next = vm_object_collapse_scan_wait(object, pp, next, | next = vm_object_collapse_scan_wait(object, pp, next, | ||||
op); | op); | ||||
continue; | continue; | ||||
} | } | ||||
KASSERT(pp == NULL || !vm_page_none_valid(pp), | if (pp != NULL && vm_page_none_valid(pp)) { | ||||
("unbusy invalid page %p", pp)); | /* | ||||
* The page was invalid in the parent. Likely placed | |||||
* there by an incomplete fault. Just remove and | |||||
* ignore. p can replace it. | |||||
*/ | |||||
if (vm_page_remove(pp)) | |||||
vm_page_free(pp); | |||||
else | |||||
vm_page_xunbusy(pp); | |||||
pp = NULL; | |||||
} | |||||
if (pp != NULL || vm_pager_has_page(object, new_pindex, NULL, | if (pp != NULL || vm_pager_has_page(object, new_pindex, NULL, | ||||
NULL)) { | NULL)) { | ||||
/* | /* | ||||
* The page already exists in the parent OR swap exists | * The page already exists in the parent OR swap exists | ||||
* for this location in the parent. Leave the parent's | * for this location in the parent. Leave the parent's | ||||
* page alone. Destroy the original page from the | * page alone. Destroy the original page from the | ||||
* backing object. | * backing object. | ||||
▲ Show 20 Lines • Show All 1,049 Lines • Show Last 20 Lines |