summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-07-25 18:58:39 +0000
committeralc <alc@FreeBSD.org>2003-07-25 18:58:39 +0000
commitbc3b4547208b8fb8740099776380c8e12333f06c (patch)
tree4a7e1513f9d4ce71ff680c8fd63f661ea2e4a812 /sys/ia64
parent59092046bae701082b0e4b28188b2d2e6d672bb3 (diff)
downloadFreeBSD-src-bc3b4547208b8fb8740099776380c8e12333f06c.zip
FreeBSD-src-bc3b4547208b8fb8740099776380c8e12333f06c.tar.gz
MFi386 revision 1.416
Add vm object locking to pmap_prefault(). Note: powerpc and sparc64 do not implement this function.
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/pmap.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c
index 42204d7..5fedbf0 100644
--- a/sys/ia64/ia64/pmap.c
+++ b/sys/ia64/ia64/pmap.c
@@ -1811,7 +1811,7 @@ pmap_prefault(pmap, addra, entry)
mpte = NULL;
for (i = 0; i < PAGEORDER_SIZE; i++) {
- vm_object_t lobject;
+ vm_object_t backing_object, lobject;
struct ia64_lpte *pte;
addr = addra + pmap_prefault_pageorder[i];
@@ -1827,15 +1827,18 @@ pmap_prefault(pmap, addra, entry)
pindex = ((addr - entry->start) + entry->offset) >> PAGE_SHIFT;
lobject = object;
- for (m = vm_page_lookup(lobject, pindex);
- (!m && (lobject->type == OBJT_DEFAULT) && (lobject->backing_object));
- lobject = lobject->backing_object) {
+ VM_OBJECT_LOCK(lobject);
+ while ((m = vm_page_lookup(lobject, pindex)) == NULL &&
+ lobject->type == OBJT_DEFAULT &&
+ (backing_object = lobject->backing_object) != NULL) {
if (lobject->backing_object_offset & PAGE_MASK)
break;
- pindex += (lobject->backing_object_offset >> PAGE_SHIFT);
- m = vm_page_lookup(lobject->backing_object, pindex);
+ pindex += lobject->backing_object_offset >> PAGE_SHIFT;
+ VM_OBJECT_LOCK(backing_object);
+ VM_OBJECT_UNLOCK(lobject);
+ lobject = backing_object;
}
-
+ VM_OBJECT_UNLOCK(lobject);
/*
* give-up when a page is not in memory
*/
OpenPOWER on IntegriCloud