From nobody@FreeBSD.org  Wed Apr  6 09:53:02 2011
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 EA62F1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Apr 2011 09:53:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id DA92B8FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Apr 2011 09:53:02 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p369r2Af007502
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 6 Apr 2011 09:53:02 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p369r2xx007497;
	Wed, 6 Apr 2011 09:53:02 GMT
	(envelope-from nobody)
Message-Id: <201104060953.p369r2xx007497@red.freebsd.org>
Date: Wed, 6 Apr 2011 09:53:02 GMT
From: Marcus Reid <marcus@blazingdot.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: IO on ZFS filesystems does not register in top's IO mode (patch included)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         156218
>Category:       kern
>Synopsis:       [zfs] IO on ZFS filesystems does not register in top(1)'s IO mode (patch included)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pjd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 06 10:00:23 UTC 2011
>Closed-Date:    Sat Nov 19 11:50:07 UTC 2011
>Last-Modified:  Thu Jan  5 10:10:09 UTC 2012
>Originator:     Marcus Reid
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD luna.megapath.biz 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Sat Mar 19 02:22:51 PDT 2011     root@luna:/usr/obj/usr/src/sys/FARK  i386
>Description:
When a process does IO on files in a ZFS filesystem, the IO does not show up in top's IO mode.  This was fixed in a previous version but never made it into zpool v28.
>How-To-Repeat:

>Fix:
The old patch is at:

http://people.freebsd.org/~avg/zfs-ru.diff

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->pjd 
Responsible-Changed-By: remko 
Responsible-Changed-When: Wed Apr 6 20:39:29 UTC 2011 
Responsible-Changed-Why:  
reassign to zfs maintainer 

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

From: Paul Guyot <pguyot@kallisys.net>
To: bug-followup@FreeBSD.org,
 marcus@blazingdot.com
Cc:  
Subject: Re: kern/156218: [zfs] IO on ZFS filesystems does not register in top(1)&#39;s IO mode (patch included)
Date: Sat, 3 Sep 2011 23:18:54 +0200

 The provided patch can be ported to 8-stable (zfs v28) as follows:
 
 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	=
 2011-09-03 20:58:38.433358843 +0000
 +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	=
 2011-09-03 20:47:55.213438417 +0000
 @@ -626,6 +626,9 @@
  		DB_DNODE_EXIT(db);
  	} else if (db->db_state =3D=3D DB_UNCACHED) {
  		spa_t *spa =3D dn->dn_objset->os_spa;
 +#ifdef _KERNEL
 +		curthread->td_ru.ru_inblock++;
 +#endif
 =20
  		if (zio =3D=3D NULL)
  			zio =3D zio_root(spa, NULL, NULL, =
 ZIO_FLAG_CANFAIL);
 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	=
 2011-09-03 20:59:05.094501013 +0000
 +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	=
 2011-09-03 20:54:49.092064065 +0000
 @@ -400,6 +400,10 @@
  		if (read) {
  			(void) dbuf_read(db, zio, dbuf_flags);
  		}
 +#ifdef _KERNEL
 +		else
 +			curthread->td_ru.ru_oublock++;
 +#endif
  		dbp[i] =3D &db->db;
  	}
  	rw_exit(&dn->dn_struct_rwlock);
 
State-Changed-From-To: open->patched 
State-Changed-By: pjd 
State-Changed-When: ptk 21 paź 2011 21:50:28 UTC 
State-Changed-Why:  
Fix committed to HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156218 
State-Changed-From-To: patched->closed 
State-Changed-By: pjd 
State-Changed-When: sob 19 lis 2011 11:49:33 UTC 
State-Changed-Why:  
Change committed to stable/9 and releng/9.0. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/156218: commit references a PR
Date: Thu,  5 Jan 2012 10:09:45 +0000 (UTC)

 Author: mm
 Date: Thu Jan  5 10:09:22 2012
 New Revision: 229569
 URL: http://svn.freebsd.org/changeset/base/229569
 
 Log:
   MFC r226620, r228392:
   
   MFC r226620 (pjd):
   Update per-thread I/O statistics collection in ZFS.
   This allows to see processes I/O activity in 'top -m io' output.
   
   MFC r228392 (pjd):
   Move ru_inblock increment into arc_read_nolock() so we don't account for
   cached reads.
   
   PR:		kern/156218
   Reported by:	Marcus Reid <marcus@blazingdot.com>
   Patch by:	avg
   Approved by:	pjd
 
 Modified:
   stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
   stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
 
 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
 ==============================================================================
 --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Thu Jan  5 10:03:14 2012	(r229568)
 +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Thu Jan  5 10:09:22 2012	(r229569)
 @@ -3103,6 +3103,9 @@ top:
  		ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH),
  		    demand, prefetch, hdr->b_type != ARC_BUFC_METADATA,
  		    data, metadata, misses);
 +#ifdef _KERNEL
 +		curthread->td_ru.ru_inblock++;
 +#endif
  
  		if (vd != NULL && l2arc_ndev != 0 && !(l2arc_norw && devw)) {
  			/*
 
 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
 ==============================================================================
 --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Thu Jan  5 10:03:14 2012	(r229568)
 +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Thu Jan  5 10:09:22 2012	(r229569)
 @@ -397,9 +397,12 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
  			return (EIO);
  		}
  		/* initiate async i/o */
 -		if (read) {
 +		if (read)
  			(void) dbuf_read(db, zio, dbuf_flags);
 -		}
 +#ifdef _KERNEL
 +		else
 +			curthread->td_ru.ru_oublock++;
 +#endif
  		dbp[i] = &db->db;
  	}
  	rw_exit(&dn->dn_struct_rwlock);
 _______________________________________________
 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"
 
>Unformatted:
