diff options
author | alc <alc@FreeBSD.org> | 2004-07-15 18:00:43 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-07-15 18:00:43 +0000 |
commit | 123cfa6b6464882431662931da12282fdae27c31 (patch) | |
tree | 69cdf9b62bb15fd8fb4fcd13d7dc53217029e5ad /sys/sparc64 | |
parent | c9b72f6bbfe07882de4c1ff97b23d8419bb01672 (diff) | |
download | FreeBSD-src-123cfa6b6464882431662931da12282fdae27c31.zip FreeBSD-src-123cfa6b6464882431662931da12282fdae27c31.tar.gz |
Push down the acquisition and release of the page queues lock into
pmap_protect() and pmap_remove(). In general, they require the lock in
order to modify a page's pv list or flags. In some cases, however,
pmap_protect() can avoid acquiring the lock.
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/pmap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c index 432f523..60dfc8c 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -1125,11 +1125,11 @@ pmap_remove(pmap_t pm, vm_offset_t start, vm_offset_t end) struct tte *tp; vm_offset_t va; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); CTR3(KTR_PMAP, "pmap_remove: ctx=%#lx start=%#lx end=%#lx", pm->pm_context[PCPU_GET(cpuid)], start, end); if (PMAP_REMOVE_DONE(pm)) return; + vm_page_lock_queues(); if (end - start > PMAP_TSB_THRESH) { tsb_foreach(pm, NULL, start, end, pmap_remove_tte); tlb_context_demap(pm); @@ -1142,6 +1142,7 @@ pmap_remove(pmap_t pm, vm_offset_t start, vm_offset_t end) } tlb_range_demap(pm, start, end - 1); } + vm_page_unlock_queues(); } void @@ -1214,6 +1215,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) if (prot & VM_PROT_WRITE) return; + vm_page_lock_queues(); if (eva - sva > PMAP_TSB_THRESH) { tsb_foreach(pm, NULL, sva, eva, pmap_protect_tte); tlb_context_demap(pm); @@ -1224,6 +1226,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) } tlb_range_demap(pm, sva, eva - 1); } + vm_page_unlock_queues(); } /* |