diff options
author | alc <alc@FreeBSD.org> | 2010-05-02 20:24:25 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2010-05-02 20:24:25 +0000 |
commit | 97e3b0ccbfdd08e675ae07586a31bd75fc8edde0 (patch) | |
tree | 8baf493f0c812757fd2108076f81ed88af18a4df | |
parent | 630328c1b513925136fa49a9af3f323f4a7d53c9 (diff) | |
download | FreeBSD-src-97e3b0ccbfdd08e675ae07586a31bd75fc8edde0.zip FreeBSD-src-97e3b0ccbfdd08e675ae07586a31bd75fc8edde0.tar.gz |
Simplify vm_fault(). The introduction of the new page lock renders a bit of
cleverness by vm_fault() to avoid repeatedly releasing and reacquiring the
page queues lock pointless.
Reviewed by: kib, kmacy
-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; } |