From: Nilay Shroff <nilay@linux.ibm.com>
To: linux-nvme@lists.infradead.org
Cc: dwagner@suse.de, hare@suse.com, kbusch@kernel.org, hch@lst.de,
gjoyce@ibm.com, wenxiong@linux.ibm.com,
Nilay Shroff <nilay@linux.ibm.com>
Subject: [PATCH 0/9] libnvme: add support for retrieving additional NVMe stat
Date: Sat, 21 Mar 2026 20:57:59 +0530 [thread overview]
Message-ID: <20260321152823.3197870-1-nilay@linux.ibm.com> (raw)
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!
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 | 46 ++-
libnvme/src/nvme/tree.c | 551 +++++++++++++++++++++++++++++++++++
libnvme/src/nvme/tree.h | 314 ++++++++++++++++++++
7 files changed, 944 insertions(+), 95 deletions(-)
--
2.53.0
next reply other threads:[~2026-03-21 15:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-21 15:27 Nilay Shroff [this message]
2026-03-21 15:28 ` [PATCH 1/9] libnvme: annotate nvme_path::ana_state with !accessors:none Nilay Shroff
2026-03-24 8:55 ` Daniel Wagner
2026-03-24 13:08 ` Nilay Shroff
2026-03-21 15:28 ` [PATCH 2/9] libnvme: annotate nvme_path::numa_nodes " Nilay Shroff
2026-03-21 15:28 ` [PATCH 3/9] libnvme: annotate nvme_subsystem::iopolicy " Nilay Shroff
2026-03-21 15:28 ` [PATCH 4/9] libnvme: add support for retrieving per-path gendisk I/O statistics Nilay Shroff
2026-03-24 9:05 ` Daniel Wagner
2026-03-24 13:02 ` Nilay Shroff
2026-04-01 15:42 ` Daniel Wagner
2026-04-03 15:36 ` Nilay Shroff
2026-03-21 15:28 ` [PATCH 5/9] libnvme: add support for retrieving namespace " Nilay Shroff
2026-03-24 9:06 ` Daniel Wagner
2026-03-24 13:12 ` Nilay Shroff
2026-03-21 15:28 ` [PATCH 6/9] libnvme: add support for per-path diagnostic counters Nilay Shroff
2026-03-24 9:18 ` Daniel Wagner
2026-03-24 13:54 ` Nilay Shroff
2026-04-01 15:54 ` Daniel Wagner
2026-04-03 15:47 ` Nilay Shroff
2026-03-21 15:28 ` [PATCH 7/9] libnvme: add support for namespace " Nilay Shroff
2026-03-21 15:28 ` [PATCH 8/9] libnvme: add support for nshead " Nilay Shroff
2026-03-21 15:28 ` [PATCH 9/9] libnvme: add support for ctrl " Nilay Shroff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260321152823.3197870-1-nilay@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=dwagner@suse.de \
--cc=gjoyce@ibm.com \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=wenxiong@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox