svn commit: r226620 -
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Pawel Jakub Dawidek
pjd at FreeBSD.org
Fri Oct 21 21:49:34 UTC 2011
Author: pjd
Date: Fri Oct 21 21:49:34 2011
New Revision: 226620
URL: http://svn.freebsd.org/changeset/base/226620
Log:
Update per-thread I/O statistics collection in ZFS.
This allows to see processes I/O activity in 'top -m io' output.
PR kern/156218
Reported by: Marcus Reid <marcus at blazingdot.com>
Patch by: avg
MFC after: 3 days
Modified:
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Oct 21 20:23:40 2011 (r226619)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Oct 21 21:49:34 2011 (r226620)
@@ -627,6 +627,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio
} else if (db->db_state == DB_UNCACHED) {
spa_t *spa = dn->dn_objset->os_spa;
+#ifdef _KERNEL
+ curthread->td_ru.ru_inblock++;
+#endif
+
if (zio == NULL)
zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL);
dbuf_read_impl(db, zio, &flags);
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Oct 21 20:23:40 2011 (r226619)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Oct 21 21:49:34 2011 (r226620)
@@ -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);
More information about the svn-src-head
mailing list