Don't use HZ when computing the brw_stats IO time. This brw_stats
field was formerly in jiffies, but since the conversion to ktime_t
(now always in msec) the output is incorrect when HZ != 1000.
Fixes:
4c2f028a95063aa30006a071a039e8a3eefe52f2
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ia01705b94ddedec2e375621c6e01a957f53ebbe5
Reviewed-on: https://review.whamcloud.com/33857
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sergey Cheremencev <c17829@cray.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
display_brw_stats(seq, "I/O time (1/1000s)", "ios",
&brw_stats->hist[BRW_R_IO_TIME],
- &brw_stats->hist[BRW_W_IO_TIME],
- jiffies_to_msecs(1000) / MSEC_PER_SEC);
+ &brw_stats->hist[BRW_W_IO_TIME], 1);
display_brw_stats(seq, "disk I/O size", "ios",
&brw_stats->hist[BRW_R_DISK_IOSIZE],
{
struct obd_histogram *h = osd->od_brw_stats.hist;
- if (rw == READ) {
+ if (rw == READ)
atomic_dec(&osd->od_r_in_flight);
- lprocfs_oh_tally_log2(&h[BRW_R_PAGES], npages);
- if (disksize > 0)
- lprocfs_oh_tally_log2(&h[BRW_R_DISK_IOSIZE], disksize);
- if (elapsed)
- lprocfs_oh_tally_log2(&h[BRW_R_IO_TIME], elapsed);
-
- } else {
+ else
atomic_dec(&osd->od_w_in_flight);
- lprocfs_oh_tally_log2(&h[BRW_W_PAGES], npages);
- if (disksize > 0)
- lprocfs_oh_tally_log2(&h[BRW_W_DISK_IOSIZE], disksize);
- if (elapsed)
- lprocfs_oh_tally_log2(&h[BRW_W_IO_TIME], elapsed);
- }
+
+ lprocfs_oh_tally_log2(&h[BRW_R_PAGES + rw], npages);
+ if (disksize > 0)
+ lprocfs_oh_tally_log2(&h[BRW_R_DISK_IOSIZE + rw], disksize);
+ if (elapsed)
+ lprocfs_oh_tally_log2(&h[BRW_R_IO_TIME + rw], elapsed);
}
static ssize_t __osd_read(const struct lu_env *env, struct dt_object *dt,
display_brw_stats(seq, "I/O time (1/1000s)", "ios",
&brw_stats->hist[BRW_R_IO_TIME],
- &brw_stats->hist[BRW_W_IO_TIME], 1000 / HZ);
+ &brw_stats->hist[BRW_W_IO_TIME], 1);
display_brw_stats(seq, "disk I/O size", "ios",
&brw_stats->hist[BRW_R_DISK_IOSIZE],