From ec96dca7884d77ad76e9dbb58b58b7165aa5c6d2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 16 Mar 2008 17:37:19 +0000 Subject: [PATCH] Simplify the inner loop of vm_fault()'s delete-behind heuristic. Instead of checking each page for PG_UNMANAGED, perform a one-time check whether the object is OBJT_PHYS. (PG_UNMANAGED pages only belong to OBJT_PHYS objects.) --- sys/vm/vm_fault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 71296391f509..6950c82e4f8f 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -484,7 +484,8 @@ RetryFault:; fs.pindex < fs.entry->lastr + VM_FAULT_READ)) && (fs.first_object == fs.object || (is_first_object_locked = VM_OBJECT_TRYLOCK(fs.first_object))) && - fs.first_object->type != OBJT_DEVICE) { + fs.first_object->type != OBJT_DEVICE && + fs.first_object->type != OBJT_PHYS) { vm_pindex_t firstpindex, tmppindex; if (fs.first_pindex < 2 * VM_FAULT_READ) @@ -508,7 +509,6 @@ RetryFault:; break; if (mt->busy || (mt->oflags & VPO_BUSY) || - (mt->flags & PG_UNMANAGED) || mt->hold_count || mt->wire_count) continue;