]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf bench: Add -t/--threads option to perf bench mem mmap
authorNamhyung Kim <namhyung@kernel.org>
Thu, 19 Feb 2026 00:44:17 +0000 (16:44 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 26 Feb 2026 18:54:12 +0000 (10:54 -0800)
commitc1f70c83be55e6721267f850dbfaf2ae07a04858
tree0b298997a25e37440426a62d61e2dda9678ee241
parentaf894feb32570cafea582b100d674b042479544f
perf bench: Add -t/--threads option to perf bench mem mmap

So that it can measure overhead of mmap_lock and/or per-VMA lock
contention.

  $ perf bench mem mmap -f demand -l 1000 -t 1
  # Running 'mem/mmap' benchmark:
  # function 'demand' (Demand loaded mmap())
  # Copying 1MB bytes ...

         2.786858 GB/sec

  $ perf bench mem mmap -f demand -l 1000 -t 2
  # Running 'mem/mmap' benchmark:
  # function 'demand' (Demand loaded mmap())
  # Copying 1MB bytes ...

         1.624468 GB/sec/thread   ( +-   0.30% )

  $ perf bench mem mmap -f demand -l 1000 -t 3
  # Running 'mem/mmap' benchmark:
  # function 'demand' (Demand loaded mmap())
  # Copying 1MB bytes ...

         1.493068 GB/sec/thread   ( +-   0.15% )

  $ perf bench mem mmap -f demand -l 1000 -t 4
  # Running 'mem/mmap' benchmark:
  # function 'demand' (Demand loaded mmap())
  # Copying 1MB bytes ...

         1.006087 GB/sec/thread   ( +-   0.41% )

Reviewed-by: Ankur Arora <ankur.a.arora@oracle.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/Documentation/perf-bench.txt
tools/perf/bench/mem-functions.c