[Devel] [PATCH VZ10 v2 00/11] dm-stats: total latency and per-class histograms

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Fri Jul 31 12:19:47 MSK 2026


Except for some mainstream-induced bad naming (duration) and FUA part which will probably be a dead code on our setup (but is ok to send upstream), looks good.

Reviewed-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>

On 7/27/26 18:32, Andrey Zhadchenko wrote:
> dm-stats latency histograms currently report the service time observed
> by device-mapper (start of the target I/O until completion). Under load
> that differs from the latency userspace sees, because requests may sit
> queued in the block layer for some time before dispatch.
> Also the histogram currently tracks all kinds of I/O at one place.
> 
> The first three patches fix request-based dm timing and teach histograms
> to optionally account the full block-layer lifetime of a bio (from the
> issue stamp maintained by blk-cgroup) via a new hist_total_latency
> region option. Only the histogram is switched to total latency; the
> classic counters keep reporting service time.
> 
> The remaining patches generalize a region to hold several independent
> histograms, classify each I/O into read/write/flush classes, and expose
> rd_histogram, wr_histogram and flush_histogram feature arguments that
> may be combined with the existing histogram argument. Data-less flushes,
> previously dropped by accounting because they carry zero sectors, become
> visible to flush histograms (accounted in the first area of the region
> without touching the classic counters). FUA writes are classified as
> both writes and flushes.
> 
> v2: a few small fixes regarding empty lines, hunk placement, functuon
> rename and initialization
> 
> Andrey Zhadchenko (11):
>   drivers/md/dm-rq: fix time accounting for request-based dm drivers
>   block/bio: add bio_issue_elapsed_ns()
>   drivers/md/dm-stats: add new hist_total_latency option
>   drivers/md/dm-stats: propagate operation flags instead of direction
>   drivers/md/dm-stats: prepare for multiple histograms per region
>   drivers/md/dm-stats: introduce I/O classes for histogram dispatch
>   drivers/md/dm-stats: add rd_histogram option
>   drivers/md/dm-stats: add wr_histogram option
>   drivers/md/dm-stats: prepare for accounting data-less flushes
>   drivers/md/dm-stats: add flush_histogram option
>   drivers/md/dm-stats: account FUA writes in flush histograms
> 
>  .../admin-guide/device-mapper/statistics.rst  |  37 +-
>  block/bio.c                                   |  23 ++
>  drivers/md/dm-rq.c                            |  11 +-
>  drivers/md/dm-stats.c                         | 321 ++++++++++++++----
>  drivers/md/dm-stats.h                         |   5 +-
>  drivers/md/dm.c                               |   6 +-
>  include/linux/bio.h                           |   2 +
>  7 files changed, 326 insertions(+), 79 deletions(-)
> 

-- 
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.



More information about the Devel mailing list