Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2018 20:24:21 +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: r334397 - head/sys/i386/i386
Message-ID:  <201805302024.w4UKOLs1073909@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed May 30 20:24:21 2018
New Revision: 334397
URL: https://svnweb.freebsd.org/changeset/base/334397

Log:
  Avoid unneccessary TLB shootdowns in pmap_unwire_ptp() for user pmaps,
  which no longer create recursive page table mappings.
  
  Benchmarked by:	bde
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Wed May 30 20:16:17 2018	(r334396)
+++ head/sys/i386/i386/pmap.c	Wed May 30 20:24:21 2018	(r334397)
@@ -1872,7 +1872,6 @@ pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spgli
 static void
 _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spglist *free)
 {
-	vm_offset_t pteva;
 
 	/*
 	 * unmap the page table page
@@ -1881,16 +1880,13 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spgl
 	--pmap->pm_stats.resident_count;
 
 	/*
-	 * Do an invltlb to make the invalidated mapping
-	 * take effect immediately.
+	 * There is not need to invalidate the recursive mapping since
+	 * we never instantiate such mapping for the usermode pmaps,
+	 * and never remove page table pages from the kernel pmap.
+	 * Put page on a list so that it is released since all TLB
+	 * shootdown is done.
 	 */
-	pteva = VM_MAXUSER_ADDRESS + i386_ptob(m->pindex);
-	pmap_invalidate_page(pmap, pteva);
-
-	/* 
-	 * Put page on a list so that it is released after
-	 * *ALL* TLB shootdown is done
-	 */
+	MPASS(pmap != kernel_pmap);
 	pmap_add_delayed_free_list(m, free, TRUE);
 }
 



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