[PATCHv3 0/9] libnvme: add support for retrieving additional NVMe stat
Nilay Shroff
nilay at linux.ibm.com
Thu Apr 23 00:42:20 PDT 2026
On 4/22/26 2:21 PM, Daniel Wagner wrote:
> On Tue, Apr 21, 2026 at 08:20:21PM +0530, Nilay Shroff wrote:
>> Certain NVMe attributes and statistics can change dynamically at runtime.
>> However, the current libnvme implementation caches attribute values while
>> scanning and building the topology. Subsequent libnvme API calls return
>> these cached values.
>>
>> While this approach works well for one-shot nvme-cli commands, it is not
>> suitable for use cases that require upto date information. In particular,
>> real-time monitoring tools such as nvme-top require access to the latest
>> (non-cached) values of such attributes.
>>
>> To address this, this patchset introduces support for retrieving
>> non-cached values for selected attributes whose values may change
>> dynamically. The first three patches disable auto-generated accessors
>> for ana_state, numa_nodes, and iopolicy using "!accessors:none", and
>> provide custom implementations that always return the latest values.
>>
>> In addition, libnvme lacks support for retrieving gendisk statistics, which
>> provide useful insight into disk activity (e.g., number of I/Os processed,
>> time spent servicing I/O, and in-flight I/O counts). This patchset adds
>> support for retrieving gendisk I/O statistics for both per-path and namespace
>> gendisks.
>>
>> Finally, this series adds support for retrieving diagnostic counters at
>> different levels, including per-path, namespace, nshead, and controller.
>> These counters should improve visibility into NVMe native multipath behavior.
>>
>> All of the above statistics and counters can be leveraged by tools such as
>> nvme-top to provide real-time monitoring and analysis.
>>
>> As usual, feedback and suggestions are welcome!
>
> I went ahead and applied them. I did some cosmetic formatting changes
> for the accessors generator comment and added the manually written
> getters to the python binding define table.
>
> This should unblock your work on 'nvme monitor'
>
Thanks Daniel! I'll now work on nvme monitor dashboard.
Thanks,
--Nilay
More information about the Linux-nvme
mailing list