This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH -tip] x86: Issue at least one memory barrier in stop_machine_text_poke().
- From: Mathieu Desnoyers <mathieu dot desnoyers at efficios dot com>
- To: Masami Hiramatsu <mhiramat at redhat dot com>
- Cc: Ingo Molnar <mingo at elte dot hu>, lkml <linux-kernel at vger dot kernel dot org>, systemtap <systemtap at sources dot redhat dot com>, DLE <dle-develop at lists dot sourceforge dot net>, Jason Baron <jbaron at redhat dot com>
- Date: Wed, 3 Mar 2010 16:48:57 -0500
- Subject: Re: [PATCH -tip] x86: Issue at least one memory barrier in stop_machine_text_poke().
- References: <20100303213614.GA29880@Krystal> <20100303214847.26177.98280.stgit@localhost6.localdomain6>
* 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