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
This commit is contained in:
parent
7015e5246c
commit
c5f98d1933
@ -4900,6 +4900,8 @@ retry:
|
|||||||
vm_page_aflag_set(om, PGA_REFERENCED);
|
vm_page_aflag_set(om, PGA_REFERENCED);
|
||||||
CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa);
|
CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa);
|
||||||
pv = pmap_pvh_remove(&om->md, pmap, va);
|
pv = pmap_pvh_remove(&om->md, pmap, va);
|
||||||
|
if ((newpte & PG_MANAGED) == 0)
|
||||||
|
free_pv_entry(pmap, pv);
|
||||||
if ((om->aflags & PGA_WRITEABLE) != 0 &&
|
if ((om->aflags & PGA_WRITEABLE) != 0 &&
|
||||||
TAILQ_EMPTY(&om->md.pv_list) &&
|
TAILQ_EMPTY(&om->md.pv_list) &&
|
||||||
((om->flags & PG_FICTITIOUS) != 0 ||
|
((om->flags & PG_FICTITIOUS) != 0 ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user