Skip to content

powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

Vaibhav Jain linux-nvdimm linuxppc-dev nvdimm 5 versions – Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 3 repliesApplied
  2. v32 patches 0 repliesSuperseded
  3. v2 posting 2/22 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/22 patches0 repliesSuperseded
v12 patches7 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2powerpc/papr_scm: Fetch nvdimm performance stats from PHYPDocumentation/ABI/testing/sysfs-bus-papr-pmem arch/powerpc/platforms/pseries/papr_scm.c+177 -01 reply
2/2powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metricarch/powerpc/include/uapi/asm/papr_pdsm.h arch/powerpc/platforms/pseries/papr_scm.c+58 -01 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAneesh Kumar K.V
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric

Changes since v3[1]:

* Fixed a rebase issue pointed out by Aneesh in first patch in the series.

[1] https://lore.kernel.org/linux-nvdimm/[email protected]
---

This small patchset implements kernel side support for reporting 'life_used_percentage' metric in NDCTL with dimm health output for papr-scm NVDIMMs. With corresponding NDCTL side changes output for should be like:

$ sudo ndctl list -DH
[
  {
    "dev":"nmem0",
    "health":{
      "health_state":"ok",
      "life_used_percentage":0,
      "shutdown_state":"clean"
    }
  }
]

PHYP supports H_SCM_PERFORMANCE_STATS hcall through which an LPAR can fetch various performance stats including 'fuel_gauge' percentage for an NVDIMM. 'fuel_gauge' metric indicates the usable life remaining of an NVDIMM expressed as percentage and 'life_used_percentage' can be calculated as 'life_used_percentage = 100 - fuel_gauge'.

Structure of the patchset
=========================
First patch implements necessary scaffolding needed to issue the H_SCM_PERFORMANCE_STATS hcall and fetch performance stats catalogue. The patch also implements support for 'perf_stats' sysfs attribute to report the full catalogue of supported performance stats by PHYP.

Second and final patch implements support for sending this value to libndctl by extending the PAPR_PDSM_HEALTH pdsm payload to add a new field named 'dimm_fuel_gauge' to it.

Vaibhav Jain (2):
powerpc/papr_scm: Fetch nvdimm performance stats from PHYP powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

 Documentation/ABI/testing/sysfs-bus-papr-pmem |  27 +++
 arch/powerpc/include/uapi/asm/papr_pdsm.h     |   9 +
 arch/powerpc/platforms/pseries/papr_scm.c     | 199 ++++++++++++++++++
 3 files changed, 235 insertions(+)
Signature · 4 lines
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]