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 ||
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to