]> git.baikalelectronics.ru Git - kernel.git/commit
block: use nanosecond resolution for iostat
authorOmar Sandoval <osandov@fb.com>
Fri, 21 Sep 2018 23:44:34 +0000 (16:44 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 22 Sep 2018 02:26:59 +0000 (20:26 -0600)
commit76a0daece322be6096f738e6235d95ca827132d3
tree403679b552a10c8258d4375c561421b367504781
parent87c2579a3b4a6bbe1b1a2efbbc36a715722c73e0
block: use nanosecond resolution for iostat

Klaus Kusche reported that the I/O busy time in /proc/diskstats was not
updating properly on 4.18. This is because we started using ktime to
track elapsed time, and we convert nanoseconds to jiffies when we update
the partition counter. However, this gets rounded down, so any I/Os that
take less than a jiffy are not accounted for. Previously in this case,
the value of jiffies would sometimes increment while we were doing I/O,
so at least some I/Os were accounted for.

Let's convert the stats to use nanoseconds internally. We still report
milliseconds as before, now more accurately than ever. The value is
still truncated to 32 bits for backwards compatibility.

Fixes: b4b415e34b53 ("block: consolidate struct request timestamp fields")
Cc: stable@vger.kernel.org
Reported-by: Klaus Kusche <klaus.kusche@computerix.info>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
block/blk-core.c
block/genhd.c
block/partition-generic.c
include/linux/genhd.h