diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index f8e3c3f8b7e5..4a6495f58ad4 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -652,6 +652,8 @@ RetryFault:; } PCPU_INC(cnt.v_zfod); fs.m->valid = VM_PAGE_BITS_ALL; + /* Don't try to prefault neighboring pages. */ + faultcount = 1; break; /* break to PAGE HAS BEEN FOUND */ } else { KASSERT(fs.object != next_object, @@ -897,7 +899,8 @@ RetryFault:; * won't find it (yet). */ pmap_enter(fs.map->pmap, vaddr, fault_type, fs.m, prot, wired); - if ((fault_flags & VM_FAULT_CHANGE_WIRING) == 0 && wired == 0) + if (faultcount != 1 && (fault_flags & VM_FAULT_CHANGE_WIRING) == 0 && + wired == 0) vm_fault_prefault(&fs, vaddr, faultcount, reqpage); VM_OBJECT_WLOCK(fs.object); vm_page_lock(fs.m);