public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCHv2 0/9] libnvme: add support for retrieving additional NVMe stat
@ 2026-04-04 10:14 Nilay Shroff
  2026-04-04 10:14 ` [PATCHv2 1/9] libnvme: annotate nvme_path::ana_state with !accessors:none Nilay Shroff
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Nilay Shroff @ 2026-04-04 10:14 UTC (permalink / raw)
  To: linux-nvme; +Cc: dwagner, hare, kbusch, hch, gjoyce, wenxiong

Hi,

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!

Changes from v1:
  - Avoid exposing internal state of libnvme to its users
    while exporting the nvme stat; add a switch while updating
    nvme stat which determines whether getters shall return the
    nvme diffstat or absolute stat (Daniel Wagner)
  - If libnvme API fails then return appropriate error code
    instead of -1 (Daniel Wagner)
Link to v1: https://lore.kernel.org/all/20260321152823.3197870-1-nilay@linux.ibm.com/

Nilay Shroff (9):
  libnvme: annotate nvme_path::ana_state with !accessors:none
  libnvme: annotate nvme_path::numa_nodes with !accessors:none
  libnvme: annotate nvme_subsystem::iopolicy with !accessors:none
  libnvme: add support for retrieving per-path gendisk I/O statistics
  libnvme: add support for retrieving namespace gendisk I/O statistics
  libnvme: add support for per-path diagnostic counters
  libnvme: add support for namespace diagnostic counters
  libnvme: add support for nshead diagnostic counters
  libnvme: add support for ctrl diagnostic counters

 libnvme/src/accessors.ld     |   6 -
 libnvme/src/libnvme.ld       |  36 +++
 libnvme/src/nvme/accessors.c |  39 ---
 libnvme/src/nvme/accessors.h |  47 ---
 libnvme/src/nvme/private.h   |  51 +++-
 libnvme/src/nvme/tree.c      | 563 +++++++++++++++++++++++++++++++++++
 libnvme/src/nvme/tree.h      | 297 ++++++++++++++++++
 7 files changed, 944 insertions(+), 95 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-04-04 10:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-04 10:14 [PATCHv2 0/9] libnvme: add support for retrieving additional NVMe stat Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 1/9] libnvme: annotate nvme_path::ana_state with !accessors:none Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 2/9] libnvme: annotate nvme_path::numa_nodes " Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 3/9] libnvme: annotate nvme_subsystem::iopolicy " Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 4/9] libnvme: add support for retrieving per-path gendisk I/O statistics Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 5/9] libnvme: add support for retrieving namespace " Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 6/9] libnvme: add support for per-path diagnostic counters Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 7/9] libnvme: add support for namespace " Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 8/9] libnvme: add support for nshead " Nilay Shroff
2026-04-04 10:14 ` [PATCHv2 9/9] libnvme: add support for ctrl " Nilay Shroff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox