o Lock page queue accesses by vm_page_free().

o Increment cnt.v_dfree inside vm_pageout_page_free() rather than
   at each call.
This commit is contained in:
alc 2002-07-28 05:46:47 +00:00
parent 5468b52b93
commit 7ba02c96b0

View File

@ -619,6 +619,7 @@ vm_pageout_page_free(vm_page_t m) {
vm_page_busy(m);
vm_page_protect(m, VM_PROT_NONE);
vm_page_free(m);
cnt.v_dfree++;
if (type == OBJT_SWAP || type == OBJT_DEFAULT)
vm_object_deallocate(object);
}
@ -783,8 +784,9 @@ vm_pageout_scan(int pass)
* Invalid pages can be easily freed
*/
if (m->valid == 0) {
vm_page_lock_queues();
vm_pageout_page_free(m);
cnt.v_dfree++;
vm_page_unlock_queues();
--page_shortage;
/*
@ -1075,7 +1077,6 @@ vm_pageout_scan(int pass)
}
cache_rover = (cache_rover + PQ_PRIME2) & PQ_L2_MASK;
vm_pageout_page_free(m);
cnt.v_dfree++;
}
splx(s);
vm_page_unlock_queues();