Re: [PATCH v3] powerpc/papr_scm: Fix nvdimm event mappings
On Thu, 4 Aug 2022 13:18:52 +0530, Kajol Jain wrote: > Commit 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") > added performance monitoring support for papr-scm nvdimm devices via > perf interface. Commit also added an array in papr_scm_priv > structure called "nvdimm_events_map", which got filled based on the > result of H_SCM_PERFORMANCE_STATS hcall. > > Currently there is an assumption that the order of events in the > stats buffer, returned by the hypervisor is same. And order also > happens to matches with the events specified in nvdimm driver code. > But this assumption is not documented in Power Architecture > Platform Requirements (PAPR) document. Although the order > of events happens to be same on current generation od system, but > it might not be true in future generation systems. Fix the issue, by > adding a static mapping for nvdimm events to corresponding stat-id, > and removing the dynamic map from papr_scm_priv structure. Also > remove the function papr_scm_pmu_check_events from papr_scm.c file, > as we no longer need to copy stat-ids dynamically. > > [...] Applied to powerpc/fixes. [1/1] powerpc/papr_scm: Fix nvdimm event mappings https://git.kernel.org/powerpc/c/9b1ac04698a4bfec146322502cdcd9904c1777fa cheers
Re: [PATCH v3] powerpc/papr_scm: Fix nvdimm event mappings
Kajol Jain writes: > Commit 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") > added performance monitoring support for papr-scm nvdimm devices via > perf interface. Commit also added an array in papr_scm_priv > structure called "nvdimm_events_map", which got filled based on the > result of H_SCM_PERFORMANCE_STATS hcall. > > Currently there is an assumption that the order of events in the > stats buffer, returned by the hypervisor is same. And order also > happens to matches with the events specified in nvdimm driver code. > But this assumption is not documented in Power Architecture > Platform Requirements (PAPR) document. Although the order > of events happens to be same on current generation od system, but > it might not be true in future generation systems. Fix the issue, by > adding a static mapping for nvdimm events to corresponding stat-id, > and removing the dynamic map from papr_scm_priv structure. Also > remove the function papr_scm_pmu_check_events from papr_scm.c file, > as we no longer need to copy stat-ids dynamically. > > Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") > Reported-by: Aneesh Kumar K.V > Signed-off-by: Kajol Jain > --- > arch/powerpc/platforms/pseries/papr_scm.c | 88 +++ > 1 file changed, 27 insertions(+), 61 deletions(-) > > --- > Changelog: > v2 -> v3 > - Remove function papr_scm_pmu_check_events() and replace the > event checks in papr_scm_pmu_register() function with p->stat_buffer_len > as suggested by Vaibhav Jain > Link to the patch v2: > https://lore.kernel.org/all/20220711034605.212683-1-kj...@linux.ibm.com/ V3 patch looks good to me. Reviewed-by: Vaibhav Jain -- Cheers ~ Vaibhav