From 7ba02c96b0efd6b4157956e636571283a44d6210 Mon Sep 17 00:00:00 2001 From: alc Date: Sun, 28 Jul 2002 05:46:47 +0000 Subject: [PATCH] o Lock page queue accesses by vm_page_free(). o Increment cnt.v_dfree inside vm_pageout_page_free() rather than at each call. --- sys/vm/vm_pageout.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index b9938c78b4f3..08319b86f456 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 @@ 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();