summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-11-23 04:48:13 +0000
committeralc <alc@FreeBSD.org>2002-11-23 04:48:13 +0000
commit0e73fe8515b24f9f69b0d475ed494651c516e0ee (patch)
tree4eeba456755cf7fb9856e22073f08939a0709bb3 /sys/i386
parentdee681e4f388d3885f209446417bf5ac430ac640 (diff)
downloadFreeBSD-src-0e73fe8515b24f9f69b0d475ed494651c516e0ee.zip
FreeBSD-src-0e73fe8515b24f9f69b0d475ed494651c516e0ee.tar.gz
- Assert that the page queues lock is held in pmap_remove_all().
- Fix a diagnostic message and comment in pmap_remove_all(). - Eliminate excessive white space from pmap_remove_all(). Approved by: re
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/pmap.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index b0e43ba..c5f0c8c 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -1871,24 +1871,21 @@ pmap_remove_all(vm_page_t m)
#if defined(PMAP_DIAGNOSTIC)
/*
- * XXX this makes pmap_page_protect(NONE) illegal for non-managed
- * pages!
+ * XXX This makes pmap_remove_all() illegal for non-managed pages!
*/
if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) {
- panic("pmap_page_protect: illegal for unmanaged page, va: 0x%x", VM_PAGE_TO_PHYS(m));
+ panic("pmap_remove_all: illegal for unmanaged page, va: 0x%x",
+ VM_PAGE_TO_PHYS(m));
}
#endif
-
+ mtx_assert(&vm_page_queue_mtx, MA_OWNED);
s = splvm();
while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
pv->pv_pmap->pm_stats.resident_count--;
-
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
-
tpte = atomic_readandclear_int(pte);
if (tpte & PG_W)
pv->pv_pmap->pm_stats.wired_count--;
-
if (tpte & PG_A)
vm_page_flag_set(m, PG_REFERENCED);
@@ -1907,16 +1904,13 @@ pmap_remove_all(vm_page_t m)
vm_page_dirty(m);
}
pmap_invalidate_page(pv->pv_pmap, pv->pv_va);
-
TAILQ_REMOVE(&pv->pv_pmap->pm_pvlist, pv, pv_plist);
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
m->md.pv_list_count--;
pmap_unuse_pt(pv->pv_pmap, pv->pv_va, pv->pv_ptem);
free_pv_entry(pv);
}
-
vm_page_flag_clear(m, PG_WRITEABLE);
-
splx(s);
}
OpenPOWER on IntegriCloud