aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2013-08-04 15:56:19 +0000
committerAttilio Rao <attilio@FreeBSD.org>2013-08-04 15:56:19 +0000
commit878a788734e72093c519bd9b7c7a1aa6ce014b38 (patch)
treeab8e623361987d473ef01bd24b6f2d9a03d9cff1
parente44e975c1bb8422c21286d3d8197903bd713270c (diff)
downloadsrc-878a788734e72093c519bd9b7c7a1aa6ce014b38.tar.gz
src-878a788734e72093c519bd9b7c7a1aa6ce014b38.zip
Remove unnecessary soft busy of the page before to do vn_rdwr() in
kern_sendfile() which is unnecessary. The page is already wired so it will not be subjected to pagefault. The content cannot be effectively protected as it is full of races already. Multiple accesses to the same indexes are serialized through vn_rdwr(). Sponsored by: EMC / Isilon storage division Reviewed by: alc, jeff Tested by: pho
Notes
Notes: svn path=/head/; revision=253927
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c8
-rw-r--r--sys/kern/uipc_syscalls.c11
2 files changed, 5 insertions, 14 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index cee8d8f852c6..d867612a7bd2 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -448,10 +448,8 @@ tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx,
VM_OBJECT_WLOCK(tobj);
/*
- * The kern_sendfile() code calls vn_rdwr() with the page
- * soft-busied. Ignore the soft-busy state here. Parallel
- * reads of the page content from disk are prevented by
- * VPO_BUSY.
+ * Parallel reads of the page content from disk are prevented
+ * by VPO_BUSY.
*
* Although the tmpfs vnode lock is held here, it is
* nonetheless safe to sleep waiting for a free page. The
@@ -460,7 +458,7 @@ tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx,
* type object.
*/
m = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY |
- VM_ALLOC_IGN_SBUSY | VM_ALLOC_NOBUSY);
+ VM_ALLOC_NOBUSY);
if (m->valid != VM_PAGE_BITS_ALL) {
vm_page_busy(m);
if (vm_pager_has_page(tobj, idx, NULL, NULL)) {
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 454909ec6470..c35ef16c24cf 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -2246,11 +2246,6 @@ retry_space:
ssize_t resid;
int readahead = sfreadahead * MAXBSIZE;
- /*
- * Ensure that our page is still around
- * when the I/O completes.
- */
- vm_page_io_start(pg);
VM_OBJECT_WUNLOCK(obj);
/*
@@ -2264,11 +2259,9 @@ retry_space:
trunc_page(off), UIO_NOCOPY, IO_NODELOCKED |
IO_VMIO | ((readahead / bsize) << IO_SEQSHIFT),
td->td_ucred, NOCRED, &resid, td);
- VM_OBJECT_WLOCK(obj);
- vm_page_io_finish(pg);
- if (!error)
- VM_OBJECT_WUNLOCK(obj);
SFSTAT_INC(sf_iocnt);
+ if (error)
+ VM_OBJECT_WLOCK(obj);
}
if (error) {
vm_page_lock(pg);