Avoid unnecessary atomic operations for clearing PGA_WRITEABLE in

pmap_remove_pages().  This reduces pmap_remove_pages()'s running time by
4 to 11% in my tests.

MFC after:	1 week
This commit is contained in:
Alan Cox 2012-06-11 21:41:16 +00:00
parent 4f2380c0cf
commit efab609272
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236930

View File

@ -4197,7 +4197,8 @@ pmap_remove_pages(pmap_t pmap)
TAILQ_REMOVE(&pvh->pv_list, pv, pv_list);
if (TAILQ_EMPTY(&pvh->pv_list)) {
for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++)
if (TAILQ_EMPTY(&mt->md.pv_list))
if ((mt->aflags & PGA_WRITEABLE) != 0 &&
TAILQ_EMPTY(&mt->md.pv_list))
vm_page_aflag_clear(mt, PGA_WRITEABLE);
}
mpte = pmap_lookup_pt_page(pmap, pv->pv_va);
@ -4213,7 +4214,8 @@ pmap_remove_pages(pmap_t pmap)
} else {
pmap_resident_count_dec(pmap, 1);
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
if (TAILQ_EMPTY(&m->md.pv_list) &&
if ((m->aflags & PGA_WRITEABLE) != 0 &&
TAILQ_EMPTY(&m->md.pv_list) &&
(m->flags & PG_FICTITIOUS) == 0) {
pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
if (TAILQ_EMPTY(&pvh->pv_list))