diff options
author | alc <alc@FreeBSD.org> | 2010-05-08 20:34:01 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2010-05-08 20:34:01 +0000 |
commit | 40b44f9713de70170857e6291876dfce94b6ef43 (patch) | |
tree | 55e1683864edab13ef62b5f9fac6a4928f23f506 /sys/powerpc/aim | |
parent | 94ac1169df0fe3609aa671582574d421e89b7ff3 (diff) | |
download | FreeBSD-src-40b44f9713de70170857e6291876dfce94b6ef43.zip FreeBSD-src-40b44f9713de70170857e6291876dfce94b6ef43.tar.gz |
Push down the page queues into vm_page_cache(), vm_page_try_to_cache(), and
vm_page_try_to_free(). Consequently, push down the page queues lock into
pmap_enter_quick(), pmap_page_wired_mapped(), pmap_remove_all(), and
pmap_remove_write().
Push down the page queues lock into Xen's pmap_page_is_mapped(). (I
overlooked the Xen pmap in r207702.)
Switch to a per-processor counter for the total number of pages cached.
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 13 | ||||
-rw-r--r-- | sys/powerpc/aim/mmu_oea64.c | 14 |
2 files changed, 17 insertions, 10 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 95936ed..dc8ce0b 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1208,11 +1208,12 @@ moea_enter_quick(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot) { + vm_page_lock_queues(); PMAP_LOCK(pm); moea_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); + vm_page_unlock_queues(); PMAP_UNLOCK(pm); - } vm_paddr_t @@ -1322,10 +1323,10 @@ moea_remove_write(mmu_t mmu, vm_page_t m) pmap_t pmap; u_int lo; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || (m->flags & PG_WRITEABLE) == 0) return; + vm_page_lock_queues(); lo = moea_attr_fetch(m); powerpc_sync(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { @@ -1351,6 +1352,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m) vm_page_dirty(m); } vm_page_flag_clear(m, PG_WRITEABLE); + vm_page_unlock_queues(); } /* @@ -1518,10 +1520,11 @@ moea_page_wired_mappings(mmu_t mmu, vm_page_t m) count = 0; if (!moea_initialized || (m->flags & PG_FICTITIOUS) != 0) return (count); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) if ((pvo->pvo_vaddr & PVO_WIRED) != 0) count++; + vm_page_unlock_queues(); return (count); } @@ -1732,8 +1735,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) struct pvo_entry *pvo, *next_pvo; pmap_t pmap; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - + vm_page_lock_queues(); pvo_head = vm_page_to_pvoh(m); for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) { next_pvo = LIST_NEXT(pvo, pvo_vlink); @@ -1749,6 +1751,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) vm_page_dirty(m); } vm_page_flag_clear(m, PG_WRITEABLE); + vm_page_unlock_queues(); } /* diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 0483b41..5e329c8 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -1341,11 +1341,13 @@ void moea64_enter_quick(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot) { + + vm_page_lock_queues(); PMAP_LOCK(pm); moea64_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); + vm_page_unlock_queues(); PMAP_UNLOCK(pm); - } vm_paddr_t @@ -1517,10 +1519,10 @@ moea64_remove_write(mmu_t mmu, vm_page_t m) pmap_t pmap; uint64_t lo; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || (m->flags & PG_WRITEABLE) == 0) return; + vm_page_lock_queues(); lo = moea64_attr_fetch(m); SYNC(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { @@ -1547,6 +1549,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t m) vm_page_dirty(m); } vm_page_flag_clear(m, PG_WRITEABLE); + vm_page_unlock_queues(); } /* @@ -1710,10 +1713,11 @@ moea64_page_wired_mappings(mmu_t mmu, vm_page_t m) count = 0; if (!moea64_initialized || (m->flags & PG_FICTITIOUS) != 0) return (count); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_queues(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) if ((pvo->pvo_vaddr & PVO_WIRED) != 0) count++; + vm_page_unlock_queues(); return (count); } @@ -1929,8 +1933,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m) struct pvo_entry *pvo, *next_pvo; pmap_t pmap; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - + vm_page_lock_queues(); pvo_head = vm_page_to_pvoh(m); for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) { next_pvo = LIST_NEXT(pvo, pvo_vlink); @@ -1946,6 +1949,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m) vm_page_dirty(m); } vm_page_flag_clear(m, PG_WRITEABLE); + vm_page_unlock_queues(); } /* |