Re: [PATCH v4 13/20] perf bench: New microbenchmark for userspace mutex performance

From: Waiman Long
Date: Mon Jan 02 2017 - 13:18:33 EST


On 01/02/2017 12:16 PM, Arnaldo Carvalho de Melo wrote:
> Em Thu, Dec 29, 2016 at 11:13:39AM -0500, Waiman Long escreveu:
>> This microbenchmark simulates how the use of different futex types
>> can affect the actual performanace of userspace mutex locks. The
>> usage is:
>>
>> perf bench futex mutex <options>
> Showing the tool output is preferred, trim it if needed or state why
> that is not possible.

I will do so when I update the patchset.

>
>> Three sets of simple mutex lock and unlock functions are implemented
>> using the wait-wake, PI and TP futexes respectively. This
>> microbenchmark then runs the locking rate measurement tests using
>> either one of those mutexes or all of them consecutively.
>>
>> Signed-off-by: Waiman Long <longman@xxxxxxxxxx>
>> ---
>> tools/perf/bench/Build | 1 +
>> tools/perf/bench/bench.h | 1 +
>> tools/perf/bench/futex-locks.c | 844 +++++++++++++++++++++++++++++++++++++++++
>> tools/perf/bench/futex.h | 23 ++
>> tools/perf/builtin-bench.c | 10 +
>> tools/perf/check-headers.sh | 4 +
> You forgot to document it in tools/perf/Documentation/perf-bench.txt

Yes, I forgot about that. I will update the document in the next v5
patchset.

> Also I would suggest you submit this first without supportint TP
> futexes, i.e. supporting just what is in the kernel already, this way I
> could cherry-pick this, which would be useful already for benchmarking
> the existing types of futexes.
>
> Then, after the new futex type is accepted into the kernel, in a
> separate patch you would add support for it in 'perf bench futex mutex'.

I can separate out the TP portion of the changes and put them later in
the patchset.

Thanks for the comments.

Cheers,
Longman