Eliminate some unnecessary uses of the vm page queues lock around the

vm page's valid field.  This field is being synchronized using the
containing vm object's lock.
This commit is contained in:
Alan Cox 2003-10-04 22:47:20 +00:00
parent 272487f507
commit 6ec2fca505
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120769
2 changed files with 6 additions and 11 deletions

View File

@ -744,23 +744,19 @@ exec_map_first_page(imgp)
VOP_GETVOBJECT(imgp->vp, &object);
VM_OBJECT_LOCK(object);
ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
vm_page_lock_queues();
if ((ma[0]->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) {
vm_page_unlock_queues();
initial_pagein = VM_INITIAL_PAGEIN;
if (initial_pagein > object->size)
initial_pagein = object->size;
for (i = 1; i < initial_pagein; i++) {
if ((ma[i] = vm_page_lookup(object, i)) != NULL) {
if (ma[i]->valid)
break;
vm_page_lock_queues();
if ((ma[i]->flags & PG_BUSY) || ma[i]->busy) {
vm_page_unlock_queues();
break;
}
if (ma[i]->valid) {
vm_page_unlock_queues();
break;
}
vm_page_busy(ma[i]);
vm_page_unlock_queues();
} else {
@ -773,22 +769,23 @@ exec_map_first_page(imgp)
initial_pagein = i;
rv = vm_pager_get_pages(object, ma, initial_pagein, 0);
ma[0] = vm_page_lookup(object, 0);
vm_page_lock_queues();
if ((rv != VM_PAGER_OK) || (ma[0] == NULL) ||
(ma[0]->valid == 0)) {
if (ma[0]) {
vm_page_lock_queues();
pmap_remove_all(ma[0]);
vm_page_free(ma[0]);
vm_page_unlock_queues();
}
vm_page_unlock_queues();
VM_OBJECT_UNLOCK(object);
return (EIO);
}
}
VM_OBJECT_UNLOCK(object);
vm_page_lock_queues();
vm_page_wire(ma[0]);
vm_page_wakeup(ma[0]);
vm_page_unlock_queues();
VM_OBJECT_UNLOCK(object);
pmap_qenter((vm_offset_t)imgp->image_header, ma, 1);
imgp->firstpage = ma[0];

View File

@ -3591,9 +3591,7 @@ vm_hold_load_pages(struct buf * bp, vm_offset_t from, vm_offset_t to)
VM_OBJECT_LOCK(kernel_object);
goto tryagain;
}
vm_page_lock_queues();
p->valid = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
pmap_qenter(pg, &p, 1);
bp->b_pages[index] = p;
vm_page_lock_queues();