summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2012-06-11 21:41:16 +0000
committeralc <alc@FreeBSD.org>2012-06-11 21:41:16 +0000
commitfece26df6f404ac528422ccf427a99e286577eaf (patch)
tree0143fe2ad61b368bf3afdbfcd8b2de1cd83398af /sys/amd64
parent6a1a47c355eb1428f5c14e63ee76b3eb5644813a (diff)
downloadFreeBSD-src-fece26df6f404ac528422ccf427a99e286577eaf.zip
FreeBSD-src-fece26df6f404ac528422ccf427a99e286577eaf.tar.gz
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
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 35cb131..507c685 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -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))
OpenPOWER on IntegriCloud