Skip to content

Commit

Permalink
perf bench: Fix order of arguments to memcpy_alloc_mem
Browse files Browse the repository at this point in the history
This was causing the destination instead of the source to be filled.  As
a result, the source was typically all mapped to one zero page, and
hence very cacheable.

Signed-off-by: Bruce Merry <bmerry@ska.ac.za>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150115092022.GA11292@kryton
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Bruce Merry authored and Arnaldo Carvalho de Melo committed Feb 23, 2015
1 parent 2a6730c commit e17fdae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/perf/bench/mem-memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static u64 do_memcpy_cycle(const struct routine *r, size_t len, bool prefault)
memcpy_t fn = r->fn.memcpy;
int i;

memcpy_alloc_mem(&src, &dst, len);
memcpy_alloc_mem(&dst, &src, len);

if (prefault)
fn(dst, src, len);
Expand All @@ -312,7 +312,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t len,
void *src = NULL, *dst = NULL;
int i;

memcpy_alloc_mem(&src, &dst, len);
memcpy_alloc_mem(&dst, &src, len);

if (prefault)
fn(dst, src, len);
Expand Down

0 comments on commit e17fdae

Please sign in to comment.