public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH -tip 1/2] perf probe: Correct probe syntax on command line help
@ 2010-03-03 21:20 Masami Hiramatsu
  2010-03-03 21:20 ` [PATCH -tip 2/2] x86: Issue at least one memory barrier in stop_machine_text_poke() Masami Hiramatsu
  0 siblings, 1 reply; 6+ messages in thread
From: Masami Hiramatsu @ 2010-03-03 21:20 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Ingo Molnar,
	Frederic Weisbecker, Arnaldo Carvalho de Melo, Peter Zijlstra,
	Paul Mackerras, Mike Galbraith, K.Prasad

Move @SRC right after FUNC in syntax according to syntax change
on command line help.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
---

 tools/perf/builtin-probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index e3dfd0d..c30a335 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -177,7 +177,7 @@ static const struct option options[] = {
 #ifdef NO_DWARF_SUPPORT
 		"[EVENT=]FUNC[+OFF|%return] [ARG ...]",
 #else
-		"[EVENT=]FUNC[+OFF|%return|:RL|;PT][@SRC]|SRC:AL|SRC;PT"
+		"[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT"
 		" [ARG ...]",
 #endif
 		"probe point definition, where\n"


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

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

* [PATCH -tip 2/2] x86: Issue at least one memory barrier in  stop_machine_text_poke().
  2010-03-03 21:20 [PATCH -tip 1/2] perf probe: Correct probe syntax on command line help Masami Hiramatsu
@ 2010-03-03 21:20 ` Masami Hiramatsu
  2010-03-03 21:36   ` Mathieu Desnoyers
  0 siblings, 1 reply; 6+ messages in thread
From: Masami Hiramatsu @ 2010-03-03 21:20 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar,
	Jason Baron

Fix stop_machine_text_poke() to issue smp_mb() before exiting waiting
loop. Also, use ACCESS_ONCE() to check a flag according to Mathieu's
comment.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
---

 arch/x86/kernel/alternative.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 635e4f4..3236a11 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -596,9 +596,9 @@ static int __kprobes stop_machine_text_poke(void *data)
 		smp_wmb();	/* Make sure other cpus see that this has run */
 		wrote_text = 1;
 	} else {
-		while (!wrote_text)
-			smp_rmb();
-		sync_core();
+		while (!ACCESS_ONCE(wrote_text))
+			cpu_relax();
+		smp_mb();	/* Load wrote_text before following execution */
 	}
 
 	flush_icache_range((unsigned long)tpp->addr,


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

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

* Re: [PATCH -tip 2/2] x86: Issue at least one memory barrier in  stop_machine_text_poke().
  2010-03-03 21:20 ` [PATCH -tip 2/2] x86: Issue at least one memory barrier in stop_machine_text_poke() Masami Hiramatsu
@ 2010-03-03 21:36   ` Mathieu Desnoyers
  2010-03-03 21:39     ` Masami Hiramatsu
  2010-03-03 21:42     ` [PATCH -tip] " Masami Hiramatsu
  0 siblings, 2 replies; 6+ messages in thread
From: Mathieu Desnoyers @ 2010-03-03 21:36 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Ingo Molnar, lkml, systemtap, DLE, Jason Baron

* Masami Hiramatsu (mhiramat@redhat.com) wrote:
> Fix stop_machine_text_poke() to issue smp_mb() before exiting waiting
> loop. Also, use ACCESS_ONCE() to check a flag according to Mathieu's
> comment.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Jason Baron <jbaron@redhat.com>
> ---
> 
>  arch/x86/kernel/alternative.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 635e4f4..3236a11 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -596,9 +596,9 @@ static int __kprobes stop_machine_text_poke(void *data)
>  		smp_wmb();	/* Make sure other cpus see that this has run */
>  		wrote_text = 1;
>  	} else {
> -		while (!wrote_text)
> -			smp_rmb();
> -		sync_core();
> +		while (!ACCESS_ONCE(wrote_text))

Well, cpu_relax() has a "memory" clobber, so the access once is not required to
ensure the variable is re-read. And, sorry to contradict my previous statement
somewhat, but given that we don't care if the compiler fetches wrote_text in
chunks or not, ACCESS_ONCE() is not required here. So rather than leaving people
wondering why we put an ACCESS_ONCE() here, it's probably better to leave it
out.

Thanks,

Mathieu

> +			cpu_relax();
> +		smp_mb();	/* Load wrote_text before following execution */
>  	}
>  
>  	flush_icache_range((unsigned long)tpp->addr,
> 
> 
> -- 
> Masami Hiramatsu
> 
> Software Engineer
> Hitachi Computer Products (America), Inc.
> Software Solutions Division
> 
> e-mail: mhiramat@redhat.com

-- 
Mathieu Desnoyers
Operating System Efficiency Consultant
EfficiOS Inc.
http://www.efficios.com

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

* Re: [PATCH -tip 2/2] x86: Issue at least one memory barrier in stop_machine_text_poke().
  2010-03-03 21:36   ` Mathieu Desnoyers
@ 2010-03-03 21:39     ` Masami Hiramatsu
  2010-03-03 21:42     ` [PATCH -tip] " Masami Hiramatsu
  1 sibling, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2010-03-03 21:39 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: Ingo Molnar, lkml, systemtap, DLE, Jason Baron

Mathieu Desnoyers wrote:
> * Masami Hiramatsu (mhiramat@redhat.com) wrote:
>> Fix stop_machine_text_poke() to issue smp_mb() before exiting waiting
>> loop. Also, use ACCESS_ONCE() to check a flag according to Mathieu's
>> comment.
>>
>> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
>> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
>> Cc: Ingo Molnar <mingo@elte.hu>
>> Cc: Jason Baron <jbaron@redhat.com>
>> ---
>>
>>  arch/x86/kernel/alternative.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
>> index 635e4f4..3236a11 100644
>> --- a/arch/x86/kernel/alternative.c
>> +++ b/arch/x86/kernel/alternative.c
>> @@ -596,9 +596,9 @@ static int __kprobes stop_machine_text_poke(void *data)
>>  		smp_wmb();	/* Make sure other cpus see that this has run */
>>  		wrote_text = 1;
>>  	} else {
>> -		while (!wrote_text)
>> -			smp_rmb();
>> -		sync_core();
>> +		while (!ACCESS_ONCE(wrote_text))
> 
> Well, cpu_relax() has a "memory" clobber, so the access once is not required to
> ensure the variable is re-read. And, sorry to contradict my previous statement
> somewhat, but given that we don't care if the compiler fetches wrote_text in
> chunks or not, ACCESS_ONCE() is not required here. So rather than leaving people
> wondering why we put an ACCESS_ONCE() here, it's probably better to leave it
> out.

Ah, OK. Indeed, volatile is for compiler...

Thank you,

-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

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

* [PATCH -tip] x86: Issue at least one memory barrier in  stop_machine_text_poke().
  2010-03-03 21:36   ` Mathieu Desnoyers
  2010-03-03 21:39     ` Masami Hiramatsu
@ 2010-03-03 21:42     ` Masami Hiramatsu
  2010-03-03 21:49       ` Mathieu Desnoyers
  1 sibling, 1 reply; 6+ messages in thread
From: Masami Hiramatsu @ 2010-03-03 21:42 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Mathieu Desnoyers, Ingo Molnar,
	Jason Baron

Fix stop_machine_text_poke() to issue smp_mb() before exiting waiting
loop, and use cpu_relax() for waiting.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
---

 arch/x86/kernel/alternative.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 635e4f4..3a4bf35 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -597,8 +597,8 @@ static int __kprobes stop_machine_text_poke(void *data)
 		wrote_text = 1;
 	} else {
 		while (!wrote_text)
-			smp_rmb();
-		sync_core();
+			cpu_relax();
+		smp_mb();	/* Load wrote_text before following execution */
 	}
 
 	flush_icache_range((unsigned long)tpp->addr,


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

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

* Re: [PATCH -tip] x86: Issue at least one memory barrier in  stop_machine_text_poke().
  2010-03-03 21:42     ` [PATCH -tip] " Masami Hiramatsu
@ 2010-03-03 21:49       ` Mathieu Desnoyers
  0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Desnoyers @ 2010-03-03 21:49 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Ingo Molnar, lkml, systemtap, DLE, Jason Baron

* Masami Hiramatsu (mhiramat@redhat.com) wrote:
> Fix stop_machine_text_poke() to issue smp_mb() before exiting waiting
> loop, and use cpu_relax() for waiting.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Jason Baron <jbaron@redhat.com>
> ---
> 
>  arch/x86/kernel/alternative.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 635e4f4..3a4bf35 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -597,8 +597,8 @@ static int __kprobes stop_machine_text_poke(void *data)
>  		wrote_text = 1;
>  	} else {
>  		while (!wrote_text)
> -			smp_rmb();
> -		sync_core();
> +			cpu_relax();
> +		smp_mb();	/* Load wrote_text before following execution */
>  	}
>  
>  	flush_icache_range((unsigned long)tpp->addr,
> 
> 
> -- 
> Masami Hiramatsu
> 
> Software Engineer
> Hitachi Computer Products (America), Inc.
> Software Solutions Division
> 
> e-mail: mhiramat@redhat.com

-- 
Mathieu Desnoyers
Operating System Efficiency Consultant
EfficiOS Inc.
http://www.efficios.com

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

end of thread, other threads:[~2010-03-03 21:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03 21:20 [PATCH -tip 1/2] perf probe: Correct probe syntax on command line help Masami Hiramatsu
2010-03-03 21:20 ` [PATCH -tip 2/2] x86: Issue at least one memory barrier in stop_machine_text_poke() Masami Hiramatsu
2010-03-03 21:36   ` Mathieu Desnoyers
2010-03-03 21:39     ` Masami Hiramatsu
2010-03-03 21:42     ` [PATCH -tip] " Masami Hiramatsu
2010-03-03 21:49       ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).