diff options
author | alc <alc@FreeBSD.org> | 2002-07-30 18:51:07 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-07-30 18:51:07 +0000 |
commit | 34a3674724cf64c780affd10538e393939b94781 (patch) | |
tree | 87d0d1c3143536acc99d11467b33e38f1b43e1be /sys/kern/uipc_syscalls.c | |
parent | 5f36208df2d93cd3e6c4992accca9cc1e456e0f0 (diff) | |
download | FreeBSD-src-34a3674724cf64c780affd10538e393939b94781.zip FreeBSD-src-34a3674724cf64c780affd10538e393939b94781.tar.gz |
o In do_sendfile(), replace vm_page_sleep_busy() by vm_page_sleep_if_busy()
and extend the scope of the page queues lock to cover all accesses
to the page's flags and busy fields.
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 498dccb..3a2d143 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1788,17 +1788,17 @@ retry_lookup: VM_WAIT; goto retry_lookup; } + vm_page_lock_queues(); vm_page_wakeup(pg); } else { - if (vm_page_sleep_busy(pg, TRUE, "sfpbsy")) + vm_page_lock_queues(); + if (vm_page_sleep_if_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(); } /* @@ -1813,6 +1813,7 @@ retry_lookup: * completes. */ vm_page_io_start(pg); + vm_page_unlock_queues(); /* * Get the page from backing store. @@ -1824,10 +1825,10 @@ retry_lookup: IO_VMIO | ((MAXBSIZE / bsize) << 16), td->td_ucred, NULL, td); VOP_UNLOCK(vp, 0, td); + vm_page_lock_queues(); vm_page_flag_clear(pg, PG_ZERO); vm_page_io_finish(pg); if (error) { - vm_page_lock_queues(); vm_page_unwire(pg, 0); /* * See if anyone else might know about this page. @@ -1844,7 +1845,7 @@ retry_lookup: goto done; } } - + vm_page_unlock_queues(); /* * Get a sendfile buf. We usually wait as long as necessary, |