Re: [PATCH -tip] x86: Issue at least one memory barrier instop_machine_text_poke().

From: Mathieu Desnoyers
Date: Wed Mar 03 2010 - 16:49:13 EST


* Masami Hiramatsu (mhiramat@xxxxxxxxxx) 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@xxxxxxxxxxxx>

>
> Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxx>
> Cc: Jason Baron <jbaron@xxxxxxxxxx>
> ---
>
> 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@xxxxxxxxxx

--
Mathieu Desnoyers
Operating System Efficiency Consultant
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/