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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to