svn commit: r272202 - stable/10/sys/vm

Konstantin Belousov kib at FreeBSD.org
Sat Sep 27 07:54:28 UTC 2014


Author: kib
Date: Sat Sep 27 07:54:27 2014
New Revision: 272202
URL: http://svnweb.freebsd.org/changeset/base/272202

Log:
  MFC r272036:
  Avoid calling vm_map_pmap_enter() for the MADV_WILLNEED on the wired
  entry, the pages must be already mapped.
  
  Approved by:	re (gjb)

Modified:
  stable/10/sys/vm/vm_map.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_map.c
==============================================================================
--- stable/10/sys/vm/vm_map.c	Sat Sep 27 07:04:12 2014	(r272201)
+++ stable/10/sys/vm/vm_map.c	Sat Sep 27 07:54:27 2014	(r272202)
@@ -2209,7 +2209,14 @@ vm_map_madvise(
 
 			vm_object_madvise(current->object.vm_object, pstart,
 			    pend, behav);
-			if (behav == MADV_WILLNEED) {
+
+			/*
+			 * Pre-populate paging structures in the
+			 * WILLNEED case.  For wired entries, the
+			 * paging structures are already populated.
+			 */
+			if (behav == MADV_WILLNEED &&
+			    current->wired_count == 0) {
 				vm_map_pmap_enter(map,
 				    useStart,
 				    current->protection,


More information about the svn-src-all mailing list