diff options
-rw-r--r-- | sys/vm/vm_fault.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 5ee4ab4..f925594 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -215,7 +215,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, { vm_prot_t prot; int is_first_object_locked, result; - boolean_t are_queues_locked, growstack, wired; + boolean_t growstack, wired; int map_generation; vm_object_t next_object; vm_page_t marray[VM_FAULT_READ]; @@ -478,7 +478,6 @@ readrest: else firstpindex = fs.first_pindex - 2 * VM_FAULT_READ; - are_queues_locked = FALSE; /* * note: partially valid pages cannot be * included in the lookahead - NFS piecemeal @@ -495,17 +494,11 @@ readrest: if (mt->busy || (mt->oflags & VPO_BUSY)) continue; - if (!are_queues_locked) { - are_queues_locked = TRUE; - vm_page_lock(mt); - vm_page_lock_queues(); - } else { - vm_page_unlock_queues(); - vm_page_lock(mt); - vm_page_lock_queues(); - } + vm_page_lock(mt); + vm_page_lock_queues(); if (mt->hold_count || mt->wire_count) { + vm_page_unlock_queues(); vm_page_unlock(mt); continue; } @@ -515,10 +508,9 @@ readrest: } else { vm_page_cache(mt); } + vm_page_unlock_queues(); vm_page_unlock(mt); } - if (are_queues_locked) - vm_page_unlock_queues(); ahead += behind; behind = 0; } |