Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH v2 0/2] perf jevents: Add IOMMU PTW & device entry metrics
@ 2026-11-02 21:14 Jacob Lefkowitz via B4 Relay
  2026-11-02 21:14 ` [PATCH v2 1/2] perf jevents: add iommu page table walk metrics Jacob Lefkowitz via B4 Relay
  2026-11-02 21:14 ` [PATCH v2 2/2] perf jevents: add amd specific device table entry metrics Jacob Lefkowitz via B4 Relay
  0 siblings, 2 replies; 5+ messages in thread
From: Jacob Lefkowitz via B4 Relay @ 2026-11-02 21:14 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark
  Cc: linux-perf-users, linux-kernel, Ben Chaney, Matt Pelland,
	Jacob Lefkowitz

Adds AMD specific metrics for the IOMMU with respect to page table
walks and device table entires. The metrics cover ratios, rates, and
percentages with respect to any event which might be triggered during
a page table walk or device table entry lookup.

The metrics target Zen 2+ processors and use the standard amd_iommu
PMU events. All metrics are tested with 'sleep 10' and behave as
expected. An example output of sleep 10 is provided within each
individual change. 

The changes are split into two patches:
1. perf jevents: add iommu page table walk metrics
2. perf jevents: add amd specific device table entry metrics

The specific metris added are:
- lpm_iommu_dte_miss_rate
- lpm_iommu_dte_lookups
- lpm_iommu_ptw_reads_per_tlb_miss
- lpm_iommu_ptw_nested_read_ratio
- lpm_iommu_ptw_guest_read_ratio
- lpm_iommu_trans_per_sec

Signed-off-by: Jacob Lefkowitz <jlefkowi@akamai.com>
---
Changes in v2:
- Drop min() wrappers d_ratio() for the IOMMU ratio metrics: min(NaN, 1)
  evaluated to 1, reporting a false 100% on sockets with no amd_counts
- Did not test with previously mentioned custom workload and did not add
  to the workloads collection. The workload stressed the CPU TLB,
  but the IOMMU only translates device DMA, so the load never reaches
  the IOMMU.
- Remove unused min import
- Remove global declaration of '_zen_model' within each function
- Link to v1: https://lore.kernel.org/r/20261029-perf-tools-next-v1-0-a75a2b64a15e@akamai.com

---
Jacob Lefkowitz (2):
      perf jevents: add iommu page table walk metrics
      perf jevents: add amd specific device table entry metrics

 tools/perf/pmu-events/amd_metrics.py | 75 ++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
---
base-commit: 1c90f0a3c8a1c4e38f9edd97af9e20848805a7fb
change-id: 20261028-perf-tools-next-8fd1d433316a

Best regards,
-- 
Jacob Lefkowitz <jlefkowi@akamai.com>



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

end of thread, other threads:[~2026-11-02 21:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 21:14 [PATCH v2 0/2] perf jevents: Add IOMMU PTW & device entry metrics Jacob Lefkowitz via B4 Relay
2026-11-02 21:14 ` [PATCH v2 1/2] perf jevents: add iommu page table walk metrics Jacob Lefkowitz via B4 Relay
2026-11-02 21:22   ` sashiko-bot
2026-11-02 21:14 ` [PATCH v2 2/2] perf jevents: add amd specific device table entry metrics Jacob Lefkowitz via B4 Relay
2026-11-02 21:18   ` sashiko-bot

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