Re: [PATCH 0/2] perf jevents: Add IOMMU PTW & device entry metrics

From: Ian Rogers

Date: Thu Oct 29 2026 - 16:13:14 EST


On Thu, Oct 29, 2026 at 12:06 PM Jacob Lefkowitz via B4 Relay
<devnull+jlefkowi.akamai.com@xxxxxxxxxx> wrote:
>
> 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. They have been tested with a benchmark C program that
> purposefully thrashed the TLB as well as with 'sleep 10'; both of
> which work as expected.

Cool, perhaps consider contributing them as test workloads:
https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/workloads

> 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

This is great! +Ravi Bangoria who may know of errata around the PMU,
etc. There were some Sashiko nits, but I expect to add reviewed-by
once those are addressed.

Thanks,
Ian

> Signed-off-by: Jacob Lefkowitz <jlefkowi@xxxxxxxxxx>
> ---
> 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 | 81 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 80 insertions(+), 1 deletion(-)
> ---
> base-commit: 1c90f0a3c8a1c4e38f9edd97af9e20848805a7fb
> change-id: 20261028-perf-tools-next-8fd1d433316a
>
> Best regards,
> --
> Jacob Lefkowitz <jlefkowi@xxxxxxxxxx>
>
>