summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-10-20 21:40:17 +0000
committeralc <alc@FreeBSD.org>2002-10-20 21:40:17 +0000
commitc70af754d8642ea52fd801aea55ce454e8087432 (patch)
tree3447f622ad4fe011ad0fe9274533bd35334c4153
parent51e0dc5ceb6d274fa752496d0fc7fb0472eb1e5c (diff)
downloadFreeBSD-src-c70af754d8642ea52fd801aea55ce454e8087432.zip
FreeBSD-src-c70af754d8642ea52fd801aea55ce454e8087432.tar.gz
- Replace two instances of vm_page_sleep_busy() with the page queue
mutex-friendly vm_page_sleep_if_busy(). - Introduce page queue locking in pmap_page_lookup() and pmap_release_free_page(). - Simplify the invalidation of the pmap's ptphint in pmap_release_free_page(). (MFi386 pmap.c revision 1.362.)
-rw-r--r--sys/alpha/alpha/pmap.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c
index df7f181..8877a02 100644
--- a/sys/alpha/alpha/pmap.c
+++ b/sys/alpha/alpha/pmap.c
@@ -893,8 +893,12 @@ pmap_page_lookup(vm_object_t object, vm_pindex_t pindex)
vm_page_t m;
retry:
m = vm_page_lookup(object, pindex);
- if (m && vm_page_sleep_busy(m, FALSE, "pplookp"))
- goto retry;
+ if (m != NULL) {
+ vm_page_lock_queues();
+ if (vm_page_sleep_if_busy(m, FALSE, "pplookp"))
+ goto retry;
+ vm_page_unlock_queues();
+ }
return m;
}
@@ -1338,7 +1342,8 @@ pmap_release_free_page(pmap_t pmap, vm_page_t p)
* page-table pages. Those pages are zero now, and
* might as well be placed directly into the zero queue.
*/
- if (vm_page_sleep_busy(p, FALSE, "pmaprl"))
+ vm_page_lock_queues();
+ if (vm_page_sleep_if_busy(p, FALSE, "pmaprl"))
return 0;
vm_page_busy(p);
@@ -1361,7 +1366,7 @@ pmap_release_free_page(pmap_t pmap, vm_page_t p)
if (p->pindex == NUSERLEV3MAPS + NUSERLEV2MAPS)
bzero(pmap->pm_lev1 + K1SEGLEV1I, nklev2 * PTESIZE);
- if (pmap->pm_ptphint && (pmap->pm_ptphint->pindex == p->pindex))
+ if (pmap->pm_ptphint == p)
pmap->pm_ptphint = NULL;
#ifdef PMAP_DEBUG
@@ -1377,6 +1382,7 @@ pmap_release_free_page(pmap_t pmap, vm_page_t p)
p->wire_count--;
cnt.v_wire_count--;
vm_page_free_zero(p);
+ vm_page_unlock_queues();
return 1;
}
OpenPOWER on IntegriCloud