Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 2014 01:59:53 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261647 - head/sys/vm
Message-ID:  <201402090159.s191xr5r020102@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Feb  9 01:59:52 2014
New Revision: 261647
URL: http://svnweb.freebsd.org/changeset/base/261647

Log:
  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.

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c	Sun Feb  9 01:21:30 2014	(r261646)
+++ head/sys/vm/vm_fault.c	Sun Feb  9 01:59:52 2014	(r261647)
@@ -652,6 +652,8 @@ vnode_locked:
 			}
 			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 @@ vnode_locked:
 	 * 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402090159.s191xr5r020102>