From nobody@FreeBSD.org  Tue Dec  8 22:49:51 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 68512106568F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Dec 2009 22:49:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 56ED58FC1D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Dec 2009 22:49:51 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8MnoFK083274
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 8 Dec 2009 22:49:50 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nB8Mno26083271;
	Tue, 8 Dec 2009 22:49:50 GMT
	(envelope-from nobody)
Message-Id: <200912082249.nB8Mno26083271@www.freebsd.org>
Date: Tue, 8 Dec 2009 22:49:50 GMT
From: Michael Loftis <mloftis@wgops.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FreeBSD ZFS+sendfile severe performance issues (no cache)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         141305
>Category:       kern
>Synopsis:       [zfs] FreeBSD ZFS+sendfile severe performance issues (no cache)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-fs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 08 22:50:01 UTC 2009
>Closed-Date:    Mon Jul 08 17:04:10 UTC 2013
>Last-Modified:  Mon Jul 08 17:04:10 UTC 2013
>Originator:     Michael Loftis
>Release:        8.0
>Organization:
>Environment:
FreeBSD cs11.stilenet.com 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
sendfile from ZFS filesystems does not appear to use the read cache, and may not be read combining either.  Serving files streaming media using default lighttpd setup on FreeBSD+ZFS we get 50+mbyte/sec disk I/O and *barely* 300-400mbit output.  Same hardware, same streaming media load, it saturates a gig-e connection with ~2mbyte/sec disk I/O.  This should be easy to reproduce with any HTTP benchmark suite and anything serving with sendfile on ZFS as lighttpd does.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Kevin <kevin@your.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/141305: FreeBSD ZFS+sendfile severe performance issues (no cache)
Date: Tue, 8 Dec 2009 17:07:00 -0600

 I can confirm similar results.
 
 If the filesystem is ZFS, calling sendfile(2) over and over again on  
 the same file produces constant disk read activity correlating exactly  
 with the speed in which TCP is sending. Switching to writev(2) or  
 using UFS instead results in expected levels of disk activity.
 
 
 
 
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Dec 9 14:12:12 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141305 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/141305: commit references a PR
Date: Wed, 15 Sep 2010 10:31:35 +0000 (UTC)

 Author: avg
 Date: Wed Sep 15 10:31:27 2010
 New Revision: 212650
 URL: http://svn.freebsd.org/changeset/base/212650
 
 Log:
   tmpfs, zfs + sendfile: mark page bits as valid after populating it with data
   
   Otherwise, adding insult to injury, in addition to double-caching of data
   we would always copy the data into a vnode's vm object page from backend.
   This is specific to sendfile case only (VOP_READ with UIO_NOCOPY).
   
   PR:		kern/141305
   Reported by:	Wiktor Niesiobedzki <bsd@vink.pl>
   Reviewed by:	alc
   Tested by:	tools/regression/sockets/sendfile
   MFC after:	2 weeks
 
 Modified:
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
   head/sys/fs/tmpfs/tmpfs_vnops.c
 
 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
 ==============================================================================
 --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Sep 15 10:18:18 2010	(r212649)
 +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Sep 15 10:31:27 2010	(r212650)
 @@ -498,6 +498,8 @@ again:
  				sched_unpin();
  			}
  			VM_OBJECT_LOCK(obj);
 +			if (error == 0)
 +				vm_page_set_valid(m, off, bytes);
  			vm_page_wakeup(m);
  			if (error == 0)
  				uio->uio_resid -= bytes;
 
 Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
 ==============================================================================
 --- head/sys/fs/tmpfs/tmpfs_vnops.c	Wed Sep 15 10:18:18 2010	(r212649)
 +++ head/sys/fs/tmpfs/tmpfs_vnops.c	Wed Sep 15 10:31:27 2010	(r212650)
 @@ -562,6 +562,8 @@ lookupvpg:
  		sf_buf_free(sf);
  		sched_unpin();
  		VM_OBJECT_LOCK(vobj);
 +		if (error == 0)
 +			vm_page_set_valid(m, offset, tlen);
  		vm_page_wakeup(m);
  		VM_OBJECT_UNLOCK(vobj);
  		return	(error);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: avg 
State-Changed-When: Mon Jul 8 17:04:10 UTC 2013 
State-Changed-Why:  
This was fixed long ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141305 
>Unformatted:
