[RFC PATCHv2 4/4] nvme-multipath: add debugfs attribute for adaptive I/O policy stat

Hannes Reinecke hare at suse.de
Wed Oct 15 23:14:19 PDT 2025


On 10/15/25 08:19, Nilay Shroff wrote:
> 
> 
> On 10/13/25 12:03 PM, Hannes Reinecke wrote:
>> On 10/9/25 12:05, Nilay Shroff wrote:
>>> This commit introduces a new debugfs attribute, "adaptive_stat", under
>>> both per-path and head debugfs directories (defined under /sys/kernel/
>>> debug/block/). This attribute provides visibility into the internal
>>> state of the adaptive I/O policy to aid in debugging and performance
>>> analysis.
>>>
>>> For per-path entries, "adaptive_stat" reports the corresponding path
>>> statistics such as I/O weight, selection count, processed samples, and
>>> ignored samples.
>>>
>>> For head entries, it reports per-CPU statistics for each reachable path,
>>> including I/O weight, path score, smoothed (EWMA) latency, selection
>>> count, processed samples, and ignored samples.
>>>
>>> These additions enhance observability of the adaptive I/O path selection
>>> behavior and help diagnose imbalance or instability in multipath
>>> performance.
>>>
>>> Signed-off-by: Nilay Shroff <nilay at linux.ibm.com>
>>> ---
>>>    drivers/nvme/host/core.c      |   3 +
>>>    drivers/nvme/host/debugfs.c   | 117 ++++++++++++++++++++++++++++++++++
>>>    drivers/nvme/host/multipath.c |   2 +
>>>    3 files changed, 122 insertions(+)
>>>
>> Reviewed-by: Hannes Reinecke <hare at suse.de>
>>
>> Might be an idea to have support for queue-depth in here, too.
>>
> Currently queue_depth and numa_nodes attributes are created under
> sysfs, so do you meant to move those attributes from sysfs to
> debugfs?
> 
Yes. sysfs information can be perused by udev rules, and that assumes
the information in there will not change without a 'CHANGE' uevent.
So it's questionable whether volatile information like the queue depth
or the round-robin path selection should be presented there.
I'd rather have it moved into debugfs.

But that might be personal preference.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare at suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich



More information about the Linux-nvme mailing list