[RFC,0/4] block: add two statistic tables
mbox series

Message ID 20200708075819.4531-1-guoqing.jiang@cloud.ionos.com
Headers show
Series
  • block: add two statistic tables
Related show

Message

Guoqing Jiang July 8, 2020, 7:58 a.m. UTC
Hi,

The patchset mostly introduces some additional io stats for latency and sector,
with those tables, we can know better about the io patttern. And we want the
disk_start_io_acct returns ns instead of convert from jiffies, so some code
in drbd are changed accordingly.

For the table, the first row of below tables means the number which are "<= 1",
while the last row means the number which are ">= 1024". And the rest rows in
the table represent the number in a range.

With HZ=1000.
$ cat /sys/block/md127/io_latency
     1 ms: 3 0 0 0     - means 3 read IOs are finished less than or equal 1 ms
     2 ms: 1 0 0 0     - means 1 read IO is finished in the range [2ms, 4ms)
     4 ms: 0 0 0 0
     8 ms: 0 0 0 0
    16 ms: 1 0 0 0
    32 ms: 0 0 0 0
    64 ms: 0 0 0 0
   128 ms: 0 0 0 0
   256 ms: 0 0 0 0
   512 ms: 0 0 0 0
  1024 ms: 1 0 0 0
  2048 ms: 1 0 0 0     - means 1 read IO is finished more than or equal 2048 ms

While with HZ=100.
$ cat /sys/block/md127/io_latency
     10 ms: 3 0 0 0
     20 ms: 1 0 0 0
     40 ms: 0 0 0 0
     80 ms: 0 0 0 0
    160 ms: 1 0 0 0
    320 ms: 0 0 0 0
    640 ms: 0 0 0 0
   1280 ms: 0 0 0 0
   2560 ms: 0 0 0 0
   5120 ms: 0 0 0 0
  10240 ms: 1 0 0 0
  20480 ms: 1 0 0 0


$ cat /sys/block/md127/io_size
     1 KB: 0 0 0 0
     2 KB: 0 0 0 0
     4 KB: 0 0 0 0
     8 KB: 5 0 0 0
    16 KB: 0 0 0 0
    32 KB: 0 0 0 0
    64 KB: 0 0 0 0
   128 KB: 0 0 0 0
   256 KB: 0 0 0 0
   512 KB: 0 0 0 0
  1024 KB: 0 0 0 0
  2048 KB: 0 0 0 0

I will add a document if it is worth to add the two tables, review and comment
are welcome.

Thanks,
Guoqing

Guoqing Jiang (5):
  block: return ns precision from disk_start_io_acct
  drbd: remove unused argument from drbd_request_prepare and
    __drbd_make_request
  drbd: rename start_jif to start_ns
  block: add a statistic table for io latency
  block: add a statistic table for io sector

 block/Kconfig                     |  9 +++++
 block/blk-core.c                  | 61 +++++++++++++++++++++++++++++--
 block/genhd.c                     | 47 ++++++++++++++++++++++++
 drivers/block/drbd/drbd_debugfs.c |  8 ++--
 drivers/block/drbd/drbd_int.h     |  4 +-
 drivers/block/drbd/drbd_main.c    |  3 +-
 drivers/block/drbd/drbd_req.c     | 15 +++-----
 include/linux/part_stat.h         |  8 ++++
 8 files changed, 135 insertions(+), 20 deletions(-)