1
0
Fork 0
alistair23-linux/tools/perf/bench
Vincent Whitchurch 45989801d7 perf bench mem: Always memset source before memcpy
[ Upstream commit 1beaef29c3 ]

For memcpy, the source pages are memset to zero only when --cycles is
used.  This leads to wildly different results with or without --cycles,
since all sources pages are likely to be mapped to the same zero page
without explicit writes.

Before this fix:

$ export cmd="./perf stat -e LLC-loads -- ./perf bench \
  mem memcpy -s 1024MB -l 100 -f default"
$ $cmd

         2,935,826      LLC-loads
       3.821677452 seconds time elapsed

$ $cmd --cycles

       217,533,436      LLC-loads
       8.616725985 seconds time elapsed

After this fix:

$ $cmd

       214,459,686      LLC-loads
       8.674301124 seconds time elapsed

$ $cmd --cycles

       214,758,651      LLC-loads
       8.644480006 seconds time elapsed

Fixes: 47b5757bac ("perf bench mem: Move boilerplate memory allocation to the infrastructure")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel@axis.com
Link: http://lore.kernel.org/lkml/20200810133404.30829-1-vincent.whitchurch@axis.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-21 13:05:38 +02:00
..
Build perf bench: Add epoll_ctl(2) benchmark 2018-11-21 22:39:55 -03:00
bench.h perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
epoll-ctl.c perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
epoll-wait.c perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
futex-hash.c perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
futex-lock-pi.c perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
futex-requeue.c perf env: Remove needless cpumap.h header 2019-09-20 09:19:21 -03:00
futex-wake-parallel.c perf env: Remove needless cpumap.h header 2019-09-20 09:19:21 -03:00
futex-wake.c perf bench futex-wake: Restore thread count default to online CPU count 2020-03-18 07:17:57 +01:00
futex.h perf bench: Move HAVE_PTHREAD_ATTR_SETAFFINITY_NP into bench.h 2018-11-21 12:00:32 -03:00
mem-functions.c perf bench mem: Always memset source before memcpy 2020-08-21 13:05:38 +02:00
mem-memcpy-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memcpy-x86-64-asm-def.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memcpy-x86-64-asm.S tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' 2018-07-30 12:36:51 -03:00
mem-memcpy-x86-64-lib.c tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' 2018-07-30 12:36:51 -03:00
mem-memset-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memset-x86-64-asm-def.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memset-x86-64-asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
numa.c perf tools: Remove needless builtin.h include directives 2019-09-20 09:19:20 -03:00
sched-messaging.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
sched-pipe.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00