Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2018 21:23:04 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r336265 - stable/11/sys/vm
Message-ID:  <201807132123.w6DLN4ra037091@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Jul 13 21:23:03 2018
New Revision: 336265
URL: https://svnweb.freebsd.org/changeset/base/336265

Log:
  MFC r336030:
  Save a call to pmap_remove() if entry cannot have any pages mapped.

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

Modified: stable/11/sys/vm/vm_map.c
==============================================================================
--- stable/11/sys/vm/vm_map.c	Fri Jul 13 21:03:32 2018	(r336264)
+++ stable/11/sys/vm/vm_map.c	Fri Jul 13 21:23:03 2018	(r336265)
@@ -3099,7 +3099,14 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs
 		if (entry->wired_count != 0)
 			vm_map_entry_unwire(map, entry);
 
-		pmap_remove(map->pmap, entry->start, entry->end);
+		/*
+		 * Remove mappings for the pages, but only if the
+		 * mappings could exist.  For instance, it does not
+		 * make sense to call pmap_remove() for guard entries.
+		 */
+		if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0 ||
+		    entry->object.vm_object != NULL)
+			pmap_remove(map->pmap, entry->start, entry->end);
 
 		/*
 		 * Delete the entry only after removing all pmap



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