Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_pageout.c
Show First 20 Lines • Show All 1,301 Lines • ▼ Show 20 Lines | if (object->ref_count != 0) | ||||
act_delta = pmap_ts_referenced(m); | act_delta = pmap_ts_referenced(m); | ||||
else | else | ||||
act_delta = 0; | act_delta = 0; | ||||
if ((m->a.flags & PGA_REFERENCED) != 0) { | if ((m->a.flags & PGA_REFERENCED) != 0) { | ||||
vm_page_aflag_clear(m, PGA_REFERENCED); | vm_page_aflag_clear(m, PGA_REFERENCED); | ||||
act_delta++; | act_delta++; | ||||
} | } | ||||
/* Deferred free of swap space. */ | |||||
if ((m->a.flags & PGA_SWAP_FREE) != 0 && | |||||
VM_OBJECT_TRYWLOCK(object)) { | |||||
if (m->object == object) | |||||
vm_pager_page_unswapped(m); | |||||
VM_OBJECT_WUNLOCK(object); | |||||
} | |||||
/* | /* | ||||
* Advance or decay the act_count based on recent usage. | * Advance or decay the act_count based on recent usage. | ||||
*/ | */ | ||||
if (act_delta != 0) { | if (act_delta != 0) { | ||||
m->a.act_count += ACT_ADVANCE + act_delta; | m->a.act_count += ACT_ADVANCE + act_delta; | ||||
if (m->a.act_count > ACT_MAX) | if (m->a.act_count > ACT_MAX) | ||||
m->a.act_count = ACT_MAX; | m->a.act_count = ACT_MAX; | ||||
} else | } else | ||||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | if (vm_page_tryxbusy(m) == 0) { | ||||
* are being paged out and will leave the | * are being paged out and will leave the | ||||
* queue shortly after the scan finishes. So, | * queue shortly after the scan finishes. So, | ||||
* they ought to be discounted from the | * they ought to be discounted from the | ||||
* inactive count. | * inactive count. | ||||
*/ | */ | ||||
addl_page_shortage++; | addl_page_shortage++; | ||||
goto reinsert; | goto reinsert; | ||||
} | } | ||||
/* Deferred free of swap space. */ | |||||
if ((m->a.flags & PGA_SWAP_FREE) != 0) | |||||
vm_pager_page_unswapped(m); | |||||
/* | /* | ||||
* Re-check for wirings now that we hold the object lock and | * Re-check for wirings now that we hold the object lock and | ||||
* have verified that the page is unbusied. If the page is | * have verified that the page is unbusied. If the page is | ||||
* mapped, it may still be wired by pmap lookups. The call to | * mapped, it may still be wired by pmap lookups. The call to | ||||
* vm_page_try_remove_all() below atomically checks for such | * vm_page_try_remove_all() below atomically checks for such | ||||
* wirings and removes mappings. If the page is unmapped, the | * wirings and removes mappings. If the page is unmapped, the | ||||
* wire count is guaranteed not to increase. | * wire count is guaranteed not to increase. | ||||
▲ Show 20 Lines • Show All 713 Lines • Show Last 20 Lines |