summaryrefslogtreecommitdiffstats
path: root/sys/arm64
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2017-05-23 07:27:30 +0000
committermarkj <markj@FreeBSD.org>2017-05-23 07:27:30 +0000
commitb1d352b152cd31bddbbb83670b7f45a213ca52cb (patch)
treed6aa7d62302443402a45530a50b241fd0f5128b9 /sys/arm64
parenta6749049ae872846ba11cc9c7c14e8f8d61425f1 (diff)
downloadFreeBSD-src-b1d352b152cd31bddbbb83670b7f45a213ca52cb.zip
FreeBSD-src-b1d352b152cd31bddbbb83670b7f45a213ca52cb.tar.gz
MFC r308474, r308691, r309203, r309365, r309703, r309898, r310720,
r308489, r308706: Add PQ_LAUNDRY and remove PG_CACHED pages.
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/arm64/pmap.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index 6839758..5e2e7fc 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -2514,29 +2514,17 @@ pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte)
}
/*
- * Looks for a page table page mapping the specified virtual address in the
- * specified pmap's collection of idle page table pages. Returns NULL if there
- * is no page table page corresponding to the specified virtual address.
+ * Removes the page table page mapping the specified virtual address from the
+ * specified pmap's collection of idle page table pages, and returns it.
+ * Otherwise, returns NULL if there is no page table page corresponding to the
+ * specified virtual address.
*/
static __inline vm_page_t
-pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va)
+pmap_remove_pt_page(pmap_t pmap, vm_offset_t va)
{
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- return (vm_radix_lookup(&pmap->pm_root, pmap_l2_pindex(va)));
-}
-
-/*
- * Removes the specified page table page from the specified pmap's collection
- * of idle page table pages. The specified page table page must be a member of
- * the pmap's collection.
- */
-static __inline void
-pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte)
-{
-
- PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- vm_radix_remove(&pmap->pm_root, mpte->pindex);
+ return (vm_radix_remove(&pmap->pm_root, pmap_l2_pindex(va)));
}
/*
@@ -3605,10 +3593,9 @@ pmap_remove_pages(pmap_t pmap)
TAILQ_EMPTY(&mt->md.pv_list))
vm_page_aflag_clear(mt, PGA_WRITEABLE);
}
- ml3 = pmap_lookup_pt_page(pmap,
+ ml3 = pmap_remove_pt_page(pmap,
pv->pv_va);
if (ml3 != NULL) {
- pmap_remove_pt_page(pmap, ml3);
pmap_resident_count_dec(pmap,1);
KASSERT(ml3->wire_count == NL3PG,
("pmap_remove_pages: l3 page wire count error"));
@@ -4381,9 +4368,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va,
return (NULL);
}
- if ((ml3 = pmap_lookup_pt_page(pmap, va)) != NULL) {
- pmap_remove_pt_page(pmap, ml3);
- } else {
+ if ((ml3 = pmap_remove_pt_page(pmap, va)) == NULL) {
ml3 = vm_page_alloc(NULL, pmap_l2_pindex(va),
(VIRT_IN_DMAP(va) ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) |
VM_ALLOC_NOOBJ | VM_ALLOC_WIRED);
OpenPOWER on IntegriCloud