summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-07-28 05:46:47 +0000
committeralc <alc@FreeBSD.org>2002-07-28 05:46:47 +0000
commite3d769e49372f3888a55479a68c112f27766aa23 (patch)
tree6046b48368a1c955ed38d495780f478e5a219e94 /sys/vm
parenta5823502e912493a78124c84a1e2693259efa912 (diff)
downloadFreeBSD-src-e3d769e49372f3888a55479a68c112f27766aa23.zip
FreeBSD-src-e3d769e49372f3888a55479a68c112f27766aa23.tar.gz
o Lock page queue accesses by vm_page_free().
o Increment cnt.v_dfree inside vm_pageout_page_free() rather than at each call.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index b9938c7..08319b8 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -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 @@ rescan0:
* 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 @@ rescan0:
}
cache_rover = (cache_rover + PQ_PRIME2) & PQ_L2_MASK;
vm_pageout_page_free(m);
- cnt.v_dfree++;
}
splx(s);
vm_page_unlock_queues();
OpenPOWER on IntegriCloud