Don't call vm_fault_prefault() on zero-fill faults. It's a waste of time.

Successful prefaults after a zero-fill fault are extremely rare.
This commit is contained in:
Alan Cox 2014-02-09 01:59:52 +00:00
parent ca3eec15c0
commit 7b9b301c6b

View File

@ -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);