diff options
author | dyson <dyson@FreeBSD.org> | 1996-06-01 20:50:57 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-06-01 20:50:57 +0000 |
commit | e3cb859c1315c020a191467fb4ce2a82dcac4081 (patch) | |
tree | 5e50bdcbab509058e75b89ebea693b319d6e7484 /sys/vm | |
parent | b456bf36036581ffe84865fd3411633d89d753fc (diff) | |
download | FreeBSD-src-e3cb859c1315c020a191467fb4ce2a82dcac4081.zip FreeBSD-src-e3cb859c1315c020a191467fb4ce2a82dcac4081.tar.gz |
Disable madvise optimizations for device pager objects (some of the
operations don't work with FICTITIOUS pages.) Also, close a window
between PG_MANAGED and pmap_enter that can mess up the accounting of
the managed flag. This problem could likely cause a hold_count error
for page table pages.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_fault.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index de4ed37..ee4d920 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -66,7 +66,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_fault.c,v 1.46 1996/05/26 05:30:33 dyson Exp $ + * $Id: vm_fault.c,v 1.47 1996/05/31 00:37:56 dyson Exp $ */ /* @@ -335,7 +335,8 @@ readrest: behind = 0; } - if (first_object->behavior == OBJ_SEQUENTIAL) { + if ((first_object->type != OBJT_DEVICE) && + (first_object->behavior == OBJ_SEQUENTIAL)) { vm_pindex_t firstpindex, tmppindex; if (first_pindex < 2*(VM_FAULT_READ_BEHIND + VM_FAULT_READ_AHEAD + 1)) @@ -351,7 +352,9 @@ readrest: mt = vm_page_lookup( first_object, tmppindex); if (mt == NULL || (mt->valid != VM_PAGE_BITS_ALL)) break; - if (mt->busy || (mt->flags & PG_BUSY) || mt->hold_count || + if (mt->busy || + (mt->flags & (PG_BUSY|PG_FICTITIOUS)) || + mt->hold_count || mt->wire_count) continue; if (mt->dirty == 0) @@ -748,15 +751,15 @@ readrest: } UNLOCK_THINGS; - - m->flags |= PG_MAPPED|PG_REFERENCED; - m->flags &= ~PG_ZERO; m->valid = VM_PAGE_BITS_ALL; + m->flags &= ~PG_ZERO; pmap_enter(map->pmap, vaddr, VM_PAGE_TO_PHYS(m), prot, wired); if ((change_wiring == 0) && (wired == 0)) pmap_prefault(map->pmap, vaddr, entry, first_object); + m->flags |= PG_MAPPED|PG_REFERENCED; + /* * If the page is not wired down, then put it where the pageout daemon * can find it. |