All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric
@ 2020-06-22  4:24 ` Vaibhav Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Vaibhav Jain @ 2020-06-22  4:24 UTC (permalink / raw)
  To: linuxppc-dev, linux-nvdimm
  Cc: Vaibhav Jain, Aneesh Kumar K . V, Michael Ellerman

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 [1] 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.

References
==========
[1]
https://github.com/vaibhav92/ndctl/tree/papr_scm_health_v13_run_guage

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     | 186 ++++++++++++++++++
 3 files changed, 222 insertions(+)

-- 
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

end of thread, other threads:[~2020-06-24 17:35 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22  4:24 [PATCH 0/2] powerpc/papr_scm: add support for reporting NVDIMM 'life_used_percentage' metric Vaibhav Jain
2020-06-22  4:24 ` Vaibhav Jain
2020-06-22  4:24 ` [PATCH 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP Vaibhav Jain
2020-06-22  4:24   ` Vaibhav Jain
2020-06-23  5:42   ` Aneesh Kumar K.V
2020-06-23  5:42     ` Aneesh Kumar K.V
2020-06-23  5:52     ` Aneesh Kumar K.V
2020-06-23  5:52       ` Aneesh Kumar K.V
2020-06-23 19:02   ` Ira Weiny
2020-06-23 19:02     ` Ira Weiny
2020-06-24 14:58     ` Vaibhav Jain
2020-06-24 14:58       ` Vaibhav Jain
2020-06-24 17:33       ` Ira Weiny
2020-06-24 17:33         ` Ira Weiny
2020-06-22  4:24 ` [PATCH 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric Vaibhav Jain
2020-06-22  4:24   ` Vaibhav Jain
2020-06-23 19:14   ` Ira Weiny
2020-06-23 19:14     ` Ira Weiny
2020-06-24 14:03     ` Vaibhav Jain
2020-06-24 14:03       ` Vaibhav Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.