On Mon, May 06, 2013 at 11:05:30PM +0300, Konstantin Belousov wrote: > On Mon, May 06, 2013 at 08:16:11PM +0200, Pawel Jakub Dawidek wrote: > > On Sun, Apr 28, 2013 at 07:12:09PM +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sun Apr 28 19:12:09 2013 > > > New Revision: 250027 > > > URL: http://svnweb.freebsd.org/changeset/base/250027 > > > > > > Log: > > > Eliminate the layering violation in the kern_sendfile(). When quering > > > the file size, use VOP_GETATTR() instead of accessing vnode vm_object > > > un_pager.vnp.vnp_size. > > > > Doesn't it add extra I/O to query file system about file's attributes? > > If it does, does it matter here? > > It should not, typically. > > E.g. UFS always keeps the unpacked inode in memory for any non-reclaimed > vnode. For NFS, vnode usually caches the attributes.
I remember criticism on security.bsd.hardlink_check_[ug]id, because it added extra VOP_GETATTR() to the code path of link(2), which could hurt performance. sendfile(2) is different, as the file is open, so it should be fine indeed. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com
pgpTENs7yg0Mo.pgp
Description: PGP signature