Skip to content

RFC block: export windowed IO P99 latency

Diangang Li linux-block lkml llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1block: export windowed IO P99 latencyblock/blk-core.c block/blk-flush.c block/blk-mq.c +2 more+139 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/1] block: export windowed IO P99 latency

Production environments occasionally run into elevated tail latencies. The source can be the underlying device, but it can also be higher in the stack (filesystem contention/journaling, memory reclaim, writeback, etc.). Existing block IO statistics only provide throughput and average latency, which fail to capture the critical tail end of the latency distribution that often causes user-visible performance problems.

This patch adds windowed P99 latency tracking for block IO operations, exposing the 99th percentile latency in /proc/diskstats and /sys/block/<dev>/stat. System administrators can now monitor tail latency trends over time using tools like iostat, enabling quick validation or elimination of disk hardware as the source of latency issues.

Implementation uses per-CPU sliced ring histograms (21 buckets, 8us..~8s range) with minimal overhead. P99 values are computed by aggregating recent 1-second slices when reading statistics, reported in microseconds using bucket midpoints.

The added work on the IO path is intentionally small (bucket selection and a per-CPU counter update, with occasional per-slice reset), and in our testing it does not have a measurable impact on IO performance.

Diangang Li (1):
block: export windowed IO P99 latency

 block/blk-core.c          |  5 ++-
 block/blk-flush.c         |  6 ++-
 block/blk-mq.c            |  5 ++-
 block/genhd.c             | 50 ++++++++++++++++++++++++-
 include/linux/part_stat.h | 79 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 139 insertions(+), 6 deletions(-)
Signature · 1 line
2.39.5