1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Optimize vm_object_page_remove() by eliminating pointless calls to

pmap_remove_all().  If the object to which a page belongs has no
references, then that page cannot possibly be mapped.

Reviewed by:	kib
MFC after:	1 week
This commit is contained in:
Alan Cox 2017-09-28 17:55:41 +00:00
parent 75b2ed47b7
commit cf060942db
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=324087

View File

@ -1990,7 +1990,8 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end,
goto again;
}
if (p->wire_count != 0) {
if ((options & OBJPR_NOTMAPPED) == 0)
if ((options & OBJPR_NOTMAPPED) == 0 &&
object->ref_count != 0)
pmap_remove_all(p);
if ((options & OBJPR_CLEANONLY) == 0) {
p->valid = 0;
@ -2007,12 +2008,13 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end,
KASSERT((p->flags & PG_FICTITIOUS) == 0,
("vm_object_page_remove: page %p is fictitious", p));
if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) {
if ((options & OBJPR_NOTMAPPED) == 0)
if ((options & OBJPR_NOTMAPPED) == 0 &&
object->ref_count != 0)
pmap_remove_write(p);
if (p->dirty)
if (p->dirty != 0)
continue;
}
if ((options & OBJPR_NOTMAPPED) == 0)
if ((options & OBJPR_NOTMAPPED) == 0 && object->ref_count != 0)
pmap_remove_all(p);
p->flags &= ~PG_ZERO;
if (vm_page_free_prep(p, false))