Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/swap_pager.c
Context not available. | |||||
* For write success, clear the dirty | * For write success, clear the dirty | ||||
* status, then finish the I/O ( which decrements the | * status, then finish the I/O ( which decrements the | ||||
* busy count and possibly wakes waiter's up ). | * busy count and possibly wakes waiter's up ). | ||||
* A page is only written to swap after a period of | |||||
* inactivity. Therefore, we do not expect it to be | |||||
* reused. | |||||
*/ | */ | ||||
KASSERT(!pmap_page_is_write_mapped(m), | KASSERT(!pmap_page_is_write_mapped(m), | ||||
("swp_pager_async_iodone: page %p is not write" | ("swp_pager_async_iodone: page %p is not write" | ||||
" protected", m)); | " protected", m)); | ||||
vm_page_undirty(m); | vm_page_undirty(m); | ||||
vm_page_lock(m); | |||||
vm_page_deactivate_noreuse(m); | |||||
vm_page_unlock(m); | |||||
vm_page_sunbusy(m); | vm_page_sunbusy(m); | ||||
if (vm_page_count_severe()) { | |||||
vm_page_lock(m); | |||||
vm_page_try_to_cache(m); | |||||
vm_page_unlock(m); | |||||
} | |||||
} | } | ||||
} | } | ||||
Context not available. | |||||
/* | /* | ||||
* SWP_PAGER_FORCE_PAGEIN() - force a swap block to be paged in | * SWP_PAGER_FORCE_PAGEIN() - force a swap block to be paged in | ||||
* | * | ||||
* This routine dissociates the page at the given index within a | * This routine dissociates the page at the given index within an object | ||||
* swap block from its backing store, paging it in if necessary. | * from its backing store, paging it in if it does not reside in memory. | ||||
* If the page is paged in, it is placed in the inactive queue, | * If the page is paged in, it is marked dirty and placed in the laundry | ||||
kib: This comment is confusing IMO. Due to the backing store free, the page is marked dirty, and… | |||||
Done Inline ActionsDone. alc: Done. | |||||
* since it had its backing store ripped out from under it. | * queue. The page is marked dirty because it no longer has backing | ||||
* We also attempt to swap in all other pages in the swap block, | * store. It is placed in the laundry queue because it has not been | ||||
* we only guarantee that the one at the specified index is | * accessed recently. Otherwise, it would already reside in memory. | ||||
* | |||||
* We also attempt to swap in all other pages in the swap block. | |||||
* However, we only guarantee that the one at the specified index is | |||||
* paged in. | * paged in. | ||||
* | * | ||||
* XXX - The code to page the whole block in doesn't work, so we | * XXX - The code to page the whole block in doesn't work, so we | ||||
Context not available. | |||||
vm_object_pip_wakeup(object); | vm_object_pip_wakeup(object); | ||||
vm_page_dirty(m); | vm_page_dirty(m); | ||||
vm_page_lock(m); | vm_page_lock(m); | ||||
vm_page_deactivate(m); | vm_page_launder(m); | ||||
vm_page_unlock(m); | vm_page_unlock(m); | ||||
vm_page_xunbusy(m); | vm_page_xunbusy(m); | ||||
vm_pager_page_unswapped(m); | vm_pager_page_unswapped(m); | ||||
Context not available. |
This comment is confusing IMO. Due to the backing store free, the page is marked dirty, and not queued. But since the page is not worth keeping in memory (it was in swap after all), it should go into laundry.