diff options
author | alc <alc@FreeBSD.org> | 2004-08-09 06:01:46 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-08-09 06:01:46 +0000 |
commit | eabee22ac54b5cfae8217c73ab6968ae260ded4a (patch) | |
tree | 05b8e4e666b5deb0579ee9d750755ce73a716806 /sys/vm | |
parent | 2c2b6c4ef787e97be08d033f88dea3e54f35851f (diff) | |
download | FreeBSD-src-eabee22ac54b5cfae8217c73ab6968ae260ded4a.zip FreeBSD-src-eabee22ac54b5cfae8217c73ab6968ae260ded4a.tar.gz |
Make two changes to vm_fault().
1. Retain the map lock until after the calls to pmap_enter() and
vm_fault_prefault().
2. Remove a stale comment. Submitted by: tegge@
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_fault.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 562d255..5c9f8cf 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -771,11 +771,6 @@ readrest: vm_prot_t retry_prot; /* - * Since map entries may be pageable, make sure we can take a - * page fault on them. - */ - - /* * Unlock vnode before the lookup to avoid deadlock. E.G. * avoid a deadlock between the inode and exec_map that can * occur due to locks being obtained in different orders. @@ -890,13 +885,13 @@ readrest: vm_page_zero_invalid(fs.m, TRUE); printf("Warning: page %p partially invalid on fault\n", fs.m); } - unlock_things(&fs); + VM_OBJECT_UNLOCK(fs.object); pmap_enter(fs.map->pmap, vaddr, fs.m, prot, wired); if (((fault_flags & VM_FAULT_WIRE_MASK) == 0) && (wired == 0)) { vm_fault_prefault(fs.map->pmap, vaddr, fs.entry); } - mtx_unlock(&Giant); + VM_OBJECT_LOCK(fs.object); vm_page_lock_queues(); vm_page_flag_set(fs.m, PG_REFERENCED); @@ -915,6 +910,10 @@ readrest: vm_page_wakeup(fs.m); vm_page_unlock_queues(); + /* + * Unlock everything, and return + */ + unlock_and_deallocate(&fs); PROC_LOCK(curproc); if ((curproc->p_sflag & PS_INMEM) && curproc->p_stats) { if (hardfault) { @@ -925,10 +924,6 @@ readrest: } PROC_UNLOCK(curproc); - /* - * Unlock everything, and return - */ - vm_object_deallocate(fs.first_object); return (KERN_SUCCESS); } |