Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_pageout.c
Show First 20 Lines • Show All 454 Lines • ▼ Show 20 Lines | vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen, | ||||
* | * | ||||
* We do not have to fixup the clean/dirty bits here... we can | * We do not have to fixup the clean/dirty bits here... we can | ||||
* allow the pager to do it after the I/O completes. | * allow the pager to do it after the I/O completes. | ||||
* | * | ||||
* NOTE! mc[i]->dirty may be partial or fragmented due to an | * NOTE! mc[i]->dirty may be partial or fragmented due to an | ||||
* edge case with file fragments. | * edge case with file fragments. | ||||
*/ | */ | ||||
for (i = 0; i < count; i++) { | for (i = 0; i < count; i++) { | ||||
KASSERT(mc[i]->valid == VM_PAGE_BITS_ALL, | KASSERT(vm_page_all_valid(mc[i]), | ||||
("vm_pageout_flush: partially invalid page %p index %d/%d", | ("vm_pageout_flush: partially invalid page %p index %d/%d", | ||||
mc[i], i, count)); | mc[i], i, count)); | ||||
KASSERT((mc[i]->aflags & PGA_WRITEABLE) == 0, | KASSERT((mc[i]->aflags & PGA_WRITEABLE) == 0, | ||||
("vm_pageout_flush: writeable page %p", mc[i])); | ("vm_pageout_flush: writeable page %p", mc[i])); | ||||
vm_page_busy_downgrade(mc[i]); | vm_page_busy_downgrade(mc[i]); | ||||
} | } | ||||
vm_object_pip_add(object, count); | vm_object_pip_add(object, count); | ||||
▲ Show 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | if (__predict_false(vm_page_wired(m))) { | ||||
vm_page_dequeue_deferred(m); | vm_page_dequeue_deferred(m); | ||||
continue; | continue; | ||||
} | } | ||||
/* | /* | ||||
* Invalid pages can be easily freed. They cannot be | * Invalid pages can be easily freed. They cannot be | ||||
* mapped; vm_page_free() asserts this. | * mapped; vm_page_free() asserts this. | ||||
*/ | */ | ||||
if (m->valid == 0) | if (vm_page_none_valid(m)) | ||||
goto free_page; | goto free_page; | ||||
/* | /* | ||||
* If the page has been referenced and the object is not dead, | * If the page has been referenced and the object is not dead, | ||||
* reactivate or requeue the page depending on whether the | * reactivate or requeue the page depending on whether the | ||||
* object is mapped. | * object is mapped. | ||||
* | * | ||||
* Test PGA_REFERENCED after calling pmap_ts_referenced() so | * Test PGA_REFERENCED after calling pmap_ts_referenced() so | ||||
▲ Show 20 Lines • Show All 714 Lines • ▼ Show 20 Lines | if (__predict_false(vm_page_wired(m))) { | ||||
vm_page_dequeue_deferred(m); | vm_page_dequeue_deferred(m); | ||||
continue; | continue; | ||||
} | } | ||||
/* | /* | ||||
* Invalid pages can be easily freed. They cannot be | * Invalid pages can be easily freed. They cannot be | ||||
* mapped, vm_page_free() asserts this. | * mapped, vm_page_free() asserts this. | ||||
*/ | */ | ||||
if (m->valid == 0) | if (vm_page_none_valid(m)) | ||||
goto free_page; | goto free_page; | ||||
/* | /* | ||||
* If the page has been referenced and the object is not dead, | * If the page has been referenced and the object is not dead, | ||||
* reactivate or requeue the page depending on whether the | * reactivate or requeue the page depending on whether the | ||||
* object is mapped. | * object is mapped. | ||||
* | * | ||||
* Test PGA_REFERENCED after calling pmap_ts_referenced() so | * Test PGA_REFERENCED after calling pmap_ts_referenced() so | ||||
▲ Show 20 Lines • Show All 675 Lines • Show Last 20 Lines |