summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-10-21 21:49:34 +0000
committerpjd <pjd@FreeBSD.org>2011-10-21 21:49:34 +0000
commit1f39d42bbd7adaf5acaa21507380f702084010d4 (patch)
tree37860703b0c6c6141d4e8fb740606ee643c0fd42
parentceb37568104e3b92e5891bc0bfc72ce61af79b00 (diff)
downloadFreeBSD-src-1f39d42bbd7adaf5acaa21507380f702084010d4.zip
FreeBSD-src-1f39d42bbd7adaf5acaa21507380f702084010d4.tar.gz
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@blazingdot.com> Patch by: avg MFC after: 3 days
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
index dc9f482..7b47f87 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
@@ -627,6 +627,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
} 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);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
index 56e284a..f7d471f 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
@@ -397,9 +397,12 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length,
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);
OpenPOWER on IntegriCloud