Linux Perf Users
 help / color / mirror / Atom feed
From: Ankur Arora <ankur.a.arora@oracle.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: James Clark <james.clark@linaro.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>, Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org,
	Ankur Arora <ankur.a.arora@oracle.com>
Subject: Re: [PATCH] perf bench: Add -t/--threads option to perf bench mem mmap
Date: Mon, 15 Dec 2025 22:53:30 -0800	[thread overview]
Message-ID: <87qzsudij9.fsf@oracle.com> (raw)
In-Reply-To: <aUD6yGZ2bSHsCb2e@google.com>


Namhyung Kim <namhyung@kernel.org> writes:

> Hi James,
>
> On Tue, Dec 09, 2025 at 01:01:25PM +0000, James Clark wrote:
>>
>>
>> On 07/12/2025 8:57 am, Namhyung Kim wrote:
>> > 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.914503 GB/sec
>> >
>> >    $ perf bench mem mmap -f demand -l 1000 -t 2
>> >    # Running 'mem/mmap' benchmark:
>> >    # function 'demand' (Demand loaded mmap())
>> >    # Copying 1MB bytes ...
>> >
>> >         888.769991 MB/sec
>> >
>> >    $ perf bench mem mmap -f demand -l 1000 -t 3
>> >    # Running 'mem/mmap' benchmark:
>> >    # function 'demand' (Demand loaded mmap())
>> >    # Copying 1MB bytes ...
>> >
>> >         757.658220 MB/sec
>> >
>> >    $ perf bench mem mmap -f demand -l 1000 -t 4
>> >    # Running 'mem/mmap' benchmark:
>> >    # function 'demand' (Demand loaded mmap())
>> >    # Copying 1MB bytes ...
>> >
>> >         316.410713 MB/sec
>>
>> Should this now say "MB/sec per thread" for nr_threads > 1? I think it could
>> be interpreted either way without a label, but I see you divided by
>> nr_threads in timeval2double().
>
> Right, thanks for the review.  I think we can add it unconditionally.

Seconding the MB/sec per thread thing. But how about also adding some
kind of a variance indicator?

Maybe something like this:

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

         316.410713 MB/sec/thread        ( +-  0.56% )

--
ankur

      reply	other threads:[~2025-12-16  6:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-07  8:57 [PATCH] perf bench: Add -t/--threads option to perf bench mem mmap Namhyung Kim
2025-12-09 13:01 ` James Clark
2025-12-16  6:23   ` Namhyung Kim
2025-12-16  6:53     ` Ankur Arora [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87qzsudij9.fsf@oracle.com \
    --to=ankur.a.arora@oracle.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox