public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] perf bench: fix order of arguments to memcpy_alloc_mem
@ 2015-01-15  9:20 Bruce Merry
  2015-02-19  0:31 ` Ingo Molnar
  2015-03-01 16:49 ` [tip:perf/urgent] perf bench: Fix " tip-bot for Bruce Merry
  0 siblings, 2 replies; 3+ messages in thread
From: Bruce Merry @ 2015-01-15  9:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo

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>
---
 tools/perf/bench/mem-memcpy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
index 6c14afe..db1d3a2 100644
--- a/tools/perf/bench/mem-memcpy.c
+++ b/tools/perf/bench/mem-memcpy.c
@@ -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);
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] perf bench: fix order of arguments to memcpy_alloc_mem
  2015-01-15  9:20 [PATCH v2] perf bench: fix order of arguments to memcpy_alloc_mem Bruce Merry
@ 2015-02-19  0:31 ` Ingo Molnar
  2015-03-01 16:49 ` [tip:perf/urgent] perf bench: Fix " tip-bot for Bruce Merry
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2015-02-19  0:31 UTC (permalink / raw)
  To: Bruce Merry
  Cc: linux-kernel, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Jiri Olsa, Arnaldo Carvalho de Melo


* Bruce Merry <bmerry@ska.ac.za> wrote:

> 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>
> ---
>  tools/perf/bench/mem-memcpy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
> index 6c14afe..db1d3a2 100644
> --- a/tools/perf/bench/mem-memcpy.c
> +++ b/tools/perf/bench/mem-memcpy.c
> @@ -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);

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/urgent] perf bench: Fix order of arguments to memcpy_alloc_mem
  2015-01-15  9:20 [PATCH v2] perf bench: fix order of arguments to memcpy_alloc_mem Bruce Merry
  2015-02-19  0:31 ` Ingo Molnar
@ 2015-03-01 16:49 ` tip-bot for Bruce Merry
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Bruce Merry @ 2015-03-01 16:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, acme, paulus, bmerry, peterz, linux-kernel, tglx, mingo

Commit-ID:  e17fdaeaec066c725f73cd3cda1feae52b2646f5
Gitweb:     http://git.kernel.org/tip/e17fdaeaec066c725f73cd3cda1feae52b2646f5
Author:     Bruce Merry <bmerry@ska.ac.za>
AuthorDate: Thu, 15 Jan 2015 11:20:22 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

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>
---
 tools/perf/bench/mem-memcpy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
index 6c14afe..db1d3a2 100644
--- a/tools/perf/bench/mem-memcpy.c
+++ b/tools/perf/bench/mem-memcpy.c
@@ -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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-01 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15  9:20 [PATCH v2] perf bench: fix order of arguments to memcpy_alloc_mem Bruce Merry
2015-02-19  0:31 ` Ingo Molnar
2015-03-01 16:49 ` [tip:perf/urgent] perf bench: Fix " tip-bot for Bruce Merry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox