summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2003-07-04 22:13:39 +0000
committerAlan Cox <alc@FreeBSD.org>2003-07-04 22:13:39 +0000
commit4041408f4ffc493340cd2419ace4f3702894cc3a (patch)
tree77ee4950b78105058828d09a06de69c0c71c556e
parentc3e5b9f1541c4b170aad72c1fc3c31b16943ad7a (diff)
Notes
-rw-r--r--sys/i386/i386/pmap.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 896601093e41..0e3460099b3d 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -2312,7 +2312,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;
pt_entry_t *pte;
addr = addra + pmap_prefault_pageorder[i];
@@ -2331,15 +2331,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
*/