Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jul 2018 12:44:48 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336030 - head/sys/vm
Message-ID:  <201807061244.w66CimVq064290@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Jul  6 12:44:48 2018
New Revision: 336030
URL: https://svnweb.freebsd.org/changeset/base/336030

Log:
  Save a call to pmap_remove() if entry cannot have any pages mapped.
  
  Due to the way rtld creates mappings for the shared objects, each dso
  causes unmap of at least three guard map entries.  For instance, in
  the buildworld load, this change reduces the amount of pmap_remove()
  calls by 1/5.
  
  Profiled by:	alc
  Reviewed by:	alc, markj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D16148

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Fri Jul  6 12:37:46 2018	(r336029)
+++ head/sys/vm/vm_map.c	Fri Jul  6 12:44:48 2018	(r336030)
@@ -3158,7 +3158,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?201807061244.w66CimVq064290>