[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 03 Mar 2010 16:27:04 -0500
From: Masami Hiramatsu <mhiramat@...hat.com>
To: Ingo Molnar <mingo@...e.hu>, lkml <linux-kernel@...r.kernel.org>
Cc: systemtap <systemtap@...rces.redhat.com>,
DLE <dle-develop@...ts.sourceforge.net>,
Masami Hiramatsu <mhiramat@...hat.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Ingo Molnar <mingo@...e.hu>, Jason Baron <jbaron@...hat.com>
Subject: [PATCH -tip 2/2] x86: Issue at least one memory barrier in
stop_machine_text_poke().
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@...hat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Jason Baron <jbaron@...hat.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@...hat.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists