[PATCH 0/4] perf bench mem: Add support for PROT_MTE

From: Pierre-Clément Tosi

Date: Tue Dec 01 2026 - 07:12:54 EST


This series extend 'perf bench' to measure the overhead of mapping MTE
Tagged Memory to userspace, which is useful when evaluating the impact
of a change to page data and tag clearing within the kernel. It adds a
new --prot flag enabling callers to pass PROT_MTE during mmap().

Note that memcpy/memset are also taught about --prot as a side-effect.

As a result, users can reliably measure page tagging through e.g.

perf bench mem mmap -f populate --prot write,mte -s 128MB

Tested with arm64 (GCC) and x86-64 (GCC and Clang) builds.

(Applies cleanly to perf-tools-next at commit 4a7008f739a3)

Signed-off-by: Pierre-Clément Tosi <ptosi@xxxxxxxxxx>
---
Pierre-Clément Tosi (4):
perf bench mem: Report why mmap() failed
perf bench mem: Pass bench_params to bench_mmap()
perf bench mem: Add --prot option
perf bench mem: Support PROT_MTE on arm64

tools/perf/Documentation/perf-bench.txt | 21 +++++
tools/perf/bench/mem-functions.c | 135 ++++++++++++++++++++++++--------
2 files changed, 123 insertions(+), 33 deletions(-)
---
base-commit: 4a7008f739a30ee4c22d9f21af362a5128f2628d
change-id: 20261201-perf-prot-mte-0ffbf9bc2f7a

Best regards,
--
Pierre-Clément Tosi <ptosi@xxxxxxxxxx>