Re: [PATCH] xfs: add per-mount read/write I/O completion counters

From: Dave Chinner

Date: Sun Aug 30 2026 - 17:27:15 EST


On Thu, Aug 27, 2026 at 09:34:29PM -0600, Eric Peterson wrote:
> From: Eric Peterson <eric.peterson@xxxxxxx>
>
> Add two per-mount statistics counters, xs_read_completions and
> xs_write_completions, to complement the existing xs_read_calls and
> xs_write_calls counters. The existing counters count I/O submissions
> (entries); the new counters count I/O completions. The pair (calls,
> completions) lets a consumer compute outstanding I/O as a queue depth
> (calls - completions) and, via Little's law, derive an approximate
> response time in userspace without any hot-path timestamping.

I'm not sure the fs is the right place for this - the bdev has long
exposed enough information for filesystem-wide queue depths to be
monitored directly. e.g:

$ man iostat |grep -A 1 aqu-sz
aqu-sz The average queue length of the requests that were
issued to the device.
$ pminfo -t disk.dev.avg_qlen
disk.dev.avg_qlen [average read and write queue length]
$

and so on.

Hence this really doesn't seem like something we should be trying to
infer from indirect filesystem stats. Why can't you use the bdev
stats to get the actual filesystem wide queue depth information?

-Dave.
--
Dave Chinner
dgc@xxxxxxxxxx