]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Eliminate (many) unnecessary calls to pmap_remove_all(). Pages from objects
authoralc <alc@FreeBSD.org>
Thu, 17 Sep 2015 22:28:38 +0000 (22:28 +0000)
committeralc <alc@FreeBSD.org>
Thu, 17 Sep 2015 22:28:38 +0000 (22:28 +0000)
with a reference count of zero can't possibly be mapped, so there is never a
need for vm_page_set_invalid() to call pmap_remove_all() on them.

Reviewed by: kib
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

sys/vm/vm_page.c

index 9c4890f2c303f8f9de2e6b33521d2020c834b524..db4db2ea85fd0c81e936cf52cffe7dc5db3bce0e 100644 (file)
@@ -3096,7 +3096,8 @@ vm_page_set_invalid(vm_page_t m, int base, int size)
                bits = VM_PAGE_BITS_ALL;
        else
                bits = vm_page_bits(base, size);
-       if (m->valid == VM_PAGE_BITS_ALL && bits != 0)
+       if (object->ref_count != 0 && m->valid == VM_PAGE_BITS_ALL &&
+           bits != 0)
                pmap_remove_all(m);
        KASSERT((bits == 0 && m->valid == VM_PAGE_BITS_ALL) ||
            !pmap_page_is_mapped(m),