mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
- Make use of the VM_ALLOC_WIRED flag in the call to vm_page_alloc() in
do_sendfile(). This allows us to rearrange an if statement in order to avoid doing an unnecesary call to vm_page_lock_queues(), and an attempt at re-wiring the pages (which were wired in the vm_page_alloc() call). Reviewed by: alc, jhb
This commit is contained in:
parent
c898fd637d
commit
5d3232048e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100541
@ -1782,25 +1782,25 @@ do_sendfile(struct thread *td, struct sendfile_args *uap, int compat)
|
||||
pg = vm_page_lookup(obj, pindex);
|
||||
|
||||
if (pg == NULL) {
|
||||
pg = vm_page_alloc(obj, pindex, VM_ALLOC_NORMAL);
|
||||
pg = vm_page_alloc(obj, pindex,
|
||||
VM_ALLOC_NORMAL | VM_ALLOC_WIRED);
|
||||
if (pg == NULL) {
|
||||
VM_WAIT;
|
||||
goto retry_lookup;
|
||||
}
|
||||
vm_page_wakeup(pg);
|
||||
} else if (vm_page_sleep_busy(pg, TRUE, "sfpbsy")) {
|
||||
goto retry_lookup;
|
||||
} else {
|
||||
if (vm_page_sleep_busy(pg, TRUE, "sfpbsy"))
|
||||
goto retry_lookup;
|
||||
/*
|
||||
* Wire the page so it does not get ripped out from
|
||||
* under us.
|
||||
*/
|
||||
vm_page_lock_queues();
|
||||
vm_page_wire(pg);
|
||||
vm_page_unlock_queues();
|
||||
}
|
||||
|
||||
/*
|
||||
* Wire the page so it does not get ripped out from under
|
||||
* us.
|
||||
*/
|
||||
|
||||
vm_page_lock_queues();
|
||||
vm_page_wire(pg);
|
||||
vm_page_unlock_queues();
|
||||
|
||||
/*
|
||||
* If page is not valid for what we need, initiate I/O
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user