Skip to content

Commit

Permalink
Update per-thread I/O statistics collection in ZFS.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pjd authored and pjd committed Oct 21, 2011
1 parent ceb3756 commit 1f39d42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1f39d42

Please sign in to comment.