summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-08-04 07:07:34 +0000
committeralc <alc@FreeBSD.org>2002-08-04 07:07:34 +0000
commit9565c29f19545cb357108dc817bd5c2fa9b7fa8e (patch)
treecd6bd7fff086d2a89ed0721bb3afd0125418352d /sys
parent1d175a3d83ed45907fa4cffdd4a05c7a9cc97155 (diff)
downloadFreeBSD-src-9565c29f19545cb357108dc817bd5c2fa9b7fa8e.zip
FreeBSD-src-9565c29f19545cb357108dc817bd5c2fa9b7fa8e.tar.gz
o Extend the scope of the page queues lock in contigmalloc1().
o Replace vm_page_sleep_busy() with vm_page_sleep_if_busy() in vm_contig_launder().
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_contig.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c
index 53c2c13..3ed5021 100644
--- a/sys/vm/vm_contig.c
+++ b/sys/vm/vm_contig.c
@@ -94,30 +94,29 @@ vm_contig_launder(int queue)
next = TAILQ_NEXT(m, pageq);
KASSERT(m->queue == queue,
("vm_contig_launder: page %p's queue is not %d", m, queue));
- if (vm_page_sleep_busy(m, TRUE, "vpctw0"))
+ if (vm_page_sleep_if_busy(m, TRUE, "vpctw0")) {
+ vm_page_lock_queues();
return (TRUE);
+ }
vm_page_test_dirty(m);
if (m->dirty) {
object = m->object;
if (object->type == OBJT_VNODE) {
+ vm_page_unlock_queues();
vn_lock(object->handle,
LK_EXCLUSIVE | LK_RETRY, curthread);
vm_object_page_clean(object, 0, 0, OBJPC_SYNC);
VOP_UNLOCK(object->handle, 0, curthread);
+ vm_page_lock_queues();
return (TRUE);
} else if (object->type == OBJT_SWAP ||
object->type == OBJT_DEFAULT) {
m_tmp = m;
- vm_page_lock_queues();
vm_pageout_flush(&m_tmp, 1, 0);
- vm_page_unlock_queues();
return (TRUE);
}
- } else if (m->busy == 0 && m->hold_count == 0) {
- vm_page_lock_queues();
+ } else if (m->busy == 0 && m->hold_count == 0)
vm_page_cache(m);
- vm_page_unlock_queues();
- }
}
return (FALSE);
}
@@ -155,6 +154,7 @@ contigmalloc1(
start = 0;
for (pass = 0; pass <= 1; pass++) {
s = splvm();
+ vm_page_lock_queues();
again:
/*
* Find first page in array that is free, within range, aligned, and
@@ -181,6 +181,7 @@ again1:
goto again1;
if (vm_contig_launder(PQ_ACTIVE))
goto again1;
+ vm_page_unlock_queues();
splx(s);
continue;
}
@@ -199,7 +200,6 @@ again1:
goto again;
}
}
- vm_page_lock_queues();
for (i = start; i < (start + size / PAGE_SIZE); i++) {
vm_page_t m = &pga[i];
OpenPOWER on IntegriCloud