Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jul 2018 02:04:18 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335971 - head/sys/amd64/amd64
Message-ID:  <201807050204.w6524IRH097674@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Thu Jul  5 02:04:18 2018
New Revision: 335971
URL: https://svnweb.freebsd.org/changeset/base/335971

Log:
  As of r335784, if pmap_enter() replaces a managed mapping by an unmanaged
  mapping, then it leaks the unlinked PV entry.  This change eliminates that
  leak, freeing the PV entry.
  
  Reviewed by:	kib, markj
  X-MFC with:	r335784
  Differential Revision:	https://reviews.freebsd.org/D16130

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

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Jul  4 21:34:08 2018	(r335970)
+++ head/sys/amd64/amd64/pmap.c	Thu Jul  5 02:04:18 2018	(r335971)
@@ -4900,6 +4900,8 @@ retry:
 				vm_page_aflag_set(om, PGA_REFERENCED);
 			CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa);
 			pv = pmap_pvh_remove(&om->md, pmap, va);
+			if ((newpte & PG_MANAGED) == 0)
+				free_pv_entry(pmap, pv);
 			if ((om->aflags & PGA_WRITEABLE) != 0 &&
 			    TAILQ_EMPTY(&om->md.pv_list) &&
 			    ((om->flags & PG_FICTITIOUS) != 0 ||



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