perf bench: fix order of arguments to memcpy_alloc_mem
PATCH v2 1/1 perf bench: fix order of arguments to memcpy_alloc_mem
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.
--- tools/perf/bench/mem-memcpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/bench/mem-memcpy.c +2 -2
@@ -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);
@@ -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);
Signature · 1 line
1.9.1
Quoted 23 lines · Bruce Merry
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 <[email protected]>--- tools/perf/bench/mem-memcpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/bench/mem-memcpy.c +1
-1@@ -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);
tools/perf/bench/mem-memcpy.c static double do_memcpy_gettimeofday(const struct routine *r, size_t len, · line 318
Quoted 8 lines
tools/perf/bench/mem-memcpy.c +1
-1@@ -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);
Thanks,
Ingo
tip-bot for Bruce Merry
merge bot[tip:perf/urgent] perf bench: Fix order of arguments to memcpy_alloc_mem
In reply to Bruce Merryperf bench: Fix order of arguments to memcpy_alloc_mem
Commit-ID: e17fdaeaec066c725f73cd3cda1feae52b2646f5 Gitweb: http://git.kernel.org/tip/e17fdaeaec066c725f73cd3cda1feae52b2646f5 Author: Bruce Merry <[email protected]> AuthorDate: Thu, 15 Jan 2015 11:20:22 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Sun, 22 Feb 2015 23:10:56 -0300
perf bench: Fix order of arguments to memcpy_alloc_mem
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.
--- tools/perf/bench/mem-memcpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/bench/mem-memcpy.c +2 -2
@@ -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);
@@ -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);