All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] blk-mq request and latency stats
@ 2020-03-09 20:59 Jes Sorensen
  2020-03-09 20:59 ` [PATCH 1/7] block: keep track of per-device io sizes in stats Jes Sorensen
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Jes Sorensen @ 2020-03-09 20:59 UTC (permalink / raw)
  To: linux-block; +Cc: kernel-team, mmullins, josef, Jes Sorensen

From: Jes Sorensen <jsorensen@fb.com>

Hi,

This patchset introduces statistics collection of request sizes and
latencies for blk-mq using the blk-stat infrastructue.

This was designed to have minimal overhead when not in use. It relies on
blk_rq_stats_sectors() and introduces a sectors counter to struct
blk_rq_stat.

For request sizes it uses 8 buckets per operation type. Latencies are
tracked in us precision, and uses 32 buckets per operation type. To
not blow up the size of struct request_queue, I changed it to
dynamically allocate these data structures.

Usage, request stats are enabled like this:
 $ echo 1 > /sys/block/nvme0n1/queue/reqstat
with output reading like this:
 $ cat /sys/block/nvme0n1/queue/stat
 read: 0 0 0 8278016 14270464 29323264 120107008 2069282816
 read reqs: 0 0 0 2021 1531 1377 3229 3627
 write: 4096 0 3072 10903552 9244672 6258688 16584704 2228011008
 write reqs: 8 0 1 2662 898 311 375 4972
 discard: 0 0 0 5242880 5472256 3809280 136880128 830554112
 discard reqs: 0 0 0 1280 515 196 4150 3717

Latency stats are enabled like this:
 $ echo 1 > /sys/block/nvme0n1/queue/latstat
with output reading like this
 $  cat /sys/block/nvme0n1/queue/latency
 read: 0 0 0 0 4 101 677 5146 1162 2654 1933 832 657 52 8 0 3 2 3 2 0 0 0 0 0 0 0 0 0 0 0 0
 write: 0 0 0 79 2564 2641 8087 6226 1580 4052 498 332 385 365 382 279 323 166 109 119 188 267 0 0 0 0 0 0 0 0 0 0
 discard: 0 0 0 0 0 0 0 17709 698 15 0 1 0 0 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Cheers,
Jes


Jes Sorensen (7):
  block: keep track of per-device io sizes in stats
  block: Use blk-stat infrastructure to collect per queue request stats
  Export block request stats to sysfs
  Expand block stats to export number of of requests per bucket
  blk-mq: Only allocate request stat data when it is enabled
  blk-stat: Make bucket function take latency as an additional argument
  block: Introduce blk-mq latency stats

 block/blk-iolatency.c     |   2 +-
 block/blk-mq.c            | 110 ++++++++++++++++++++-
 block/blk-stat.c          |  18 ++--
 block/blk-stat.h          |  12 ++-
 block/blk-sysfs.c         | 195 ++++++++++++++++++++++++++++++++++++++
 block/blk-wbt.c           |   2 +-
 include/linux/blk_types.h |   1 +
 include/linux/blkdev.h    |  13 +++
 8 files changed, 338 insertions(+), 15 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-03-18 14:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 20:59 [PATCH 0/7] blk-mq request and latency stats Jes Sorensen
2020-03-09 20:59 ` [PATCH 1/7] block: keep track of per-device io sizes in stats Jes Sorensen
2020-03-09 20:59 ` [PATCH 2/7] block: Use blk-stat infrastructure to collect per queue request stats Jes Sorensen
2020-03-09 20:59 ` [PATCH 3/7] Export block request stats to sysfs Jes Sorensen
2020-03-09 20:59 ` [PATCH 4/7] Expand block stats to export number of of requests per bucket Jes Sorensen
2020-03-09 20:59 ` [PATCH 5/7] blk-mq: Only allocate request stat data when it is enabled Jes Sorensen
2020-03-09 20:59 ` [PATCH 6/7] blk-stat: Make bucket function take latency as an additional argument Jes Sorensen
2020-03-09 20:59 ` [PATCH 7/7] block: Introduce blk-mq latency stats Jes Sorensen
2020-03-18 14:49 ` [PATCH 0/7] blk-mq request and " Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.