The page queues lock is no longer required by vm_page_io_start(). Reduce

the scope of the page queues lock in kern_sendfile() accordingly.
This commit is contained in:
Alan Cox 2006-08-04 05:53:20 +00:00
parent 91449ce98c
commit 10c09f3f61

View File

@ -2038,7 +2038,6 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
VM_OBJECT_LOCK(obj);
goto retry_lookup;
}
vm_page_lock_queues();
} else {
vm_page_lock_queues();
if (vm_page_sleep_if_busy(pg, TRUE, "sfpbsy"))
@ -2048,6 +2047,7 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
* under us.
*/
vm_page_wire(pg);
vm_page_unlock_queues();
}
/*
@ -2066,7 +2066,6 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
* completes.
*/
vm_page_io_start(pg);
vm_page_unlock_queues();
VM_OBJECT_UNLOCK(obj);
/*
@ -2089,12 +2088,14 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
VM_OBJECT_LOCK(obj);
vm_page_lock_queues();
vm_page_io_finish(pg);
vm_page_unlock_queues();
if (!error)
VM_OBJECT_UNLOCK(obj);
mbstat.sf_iocnt++;
}
if (error) {
vm_page_lock_queues();
vm_page_unwire(pg, 0);
/*
* See if anyone else might know about this page.
@ -2112,7 +2113,6 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
SOCKBUF_UNLOCK(&so->so_snd);
goto done;
}
vm_page_unlock_queues();
/*
* Get a sendfile buf. We usually wait as long as necessary,