Eliminate (now) unnecessary acquisition and release of the global page

queues lock in vm_object_backing_scan().  Updates to the page's PG_BUSY
flag and busy field are synchronized by the containing object's lock.

Testing the page's hold_count and wire_count in vm_object_backing_scan()'s
OBSC_COLLAPSE_NOWAIT case is unnecessary.  There is no reason why the held
or wired pages cannot be migrated to the shadow object.

Reviewed by: tegge
This commit is contained in:
Alan Cox 2005-03-30 05:40:02 +00:00
parent 878cdac054
commit c6ec6a7cae

View File

@ -1431,19 +1431,16 @@ vm_object_backing_scan(vm_object_t object, int op)
if (op & (OBSC_COLLAPSE_WAIT | OBSC_COLLAPSE_NOWAIT)) {
vm_page_t pp;
vm_page_lock_queues();
if (op & OBSC_COLLAPSE_NOWAIT) {
if ((p->flags & PG_BUSY) ||
!p->valid ||
p->hold_count ||
p->wire_count ||
p->busy) {
vm_page_unlock_queues();
p = next;
continue;
}
} else if (op & OBSC_COLLAPSE_WAIT) {
if ((p->flags & PG_BUSY) || p->busy) {
vm_page_lock_queues();
vm_page_flag_set(p,
PG_WANTED | PG_REFERENCED);
VM_OBJECT_UNLOCK(backing_object);
@ -1463,7 +1460,6 @@ vm_object_backing_scan(vm_object_t object, int op)
continue;
}
}
vm_page_unlock_queues();
KASSERT(
p->object == backing_object,