From owner-svn-src-all@FreeBSD.ORG Sun Aug 4 15:56:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 645DF871; Sun, 4 Aug 2013 15:56:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3809B2D5E; Sun, 4 Aug 2013 15:56:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r74FuJ3j004186; Sun, 4 Aug 2013 15:56:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r74FuJ1U004183; Sun, 4 Aug 2013 15:56:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201308041556.r74FuJ1U004183@svn.freebsd.org> From: Attilio Rao Date: Sun, 4 Aug 2013 15:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253927 - in head/sys: fs/tmpfs kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2013 15:56:20 -0000 Author: attilio Date: Sun Aug 4 15:56:19 2013 New Revision: 253927 URL: http://svnweb.freebsd.org/changeset/base/253927 Log: 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 Modified: head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/uipc_syscalls.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Aug 4 11:38:08 2013 (r253926) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Aug 4 15:56:19 2013 (r253927) @@ -448,10 +448,8 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p 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_p * 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)) { Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sun Aug 4 11:38:08 2013 (r253926) +++ head/sys/kern/uipc_syscalls.c Sun Aug 4 15:56:19 2013 (r253927) @@ -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);