summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-02 20:46:17 +0000
committeralc <alc@FreeBSD.org>2010-05-02 20:46:17 +0000
commit195c62fe8294da22cc552029487344d2da10624b (patch)
tree14635494f5f14bff8b5737e5a4e411e61f77f0b1 /sys/vm
parent97e3b0ccbfdd08e675ae07586a31bd75fc8edde0 (diff)
downloadFreeBSD-src-195c62fe8294da22cc552029487344d2da10624b.zip
FreeBSD-src-195c62fe8294da22cc552029487344d2da10624b.tar.gz
Defer the acquisition of the page and page queues locks in
vm_pageout_object_deactivate_pages().
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageout.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 39a06f8..3ce8a69 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -540,6 +540,7 @@ vm_pageout_object_deactivate_pages(pmap, first_object, desired)
for (object = first_object;; object = backing_object) {
if (pmap_resident_count(pmap) <= desired)
goto unlock_return;
+ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
if (object->type == OBJT_PHYS || object->paging_in_progress)
goto unlock_return;
@@ -551,19 +552,18 @@ vm_pageout_object_deactivate_pages(pmap, first_object, desired)
*/
p = TAILQ_FIRST(&object->memq);
while (p != NULL) {
- vm_page_lock(p);
- vm_page_lock_queues();
- if (pmap_resident_count(pmap) <= desired) {
- vm_page_unlock_queues();
- vm_page_unlock(p);
+ if (pmap_resident_count(pmap) <= desired)
goto unlock_return;
- }
next = TAILQ_NEXT(p, listq);
+ if ((p->oflags & VPO_BUSY) != 0 || p->busy != 0) {
+ p = next;
+ continue;
+ }
+ vm_page_lock(p);
+ vm_page_lock_queues();
cnt.v_pdpages++;
if (p->wire_count != 0 ||
p->hold_count != 0 ||
- p->busy != 0 ||
- (p->oflags & VPO_BUSY) ||
!pmap_page_exists_quick(pmap, p)) {
vm_page_unlock_queues();
vm_page_unlock(p);
OpenPOWER on IntegriCloud