This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[tip:perf/pebs] x86: Issue at least one memory barrier in stop_machine_text_poke()
- From: tip-bot for Masami Hiramatsu <mhiramat at redhat dot com>
- To: linux-tip-commits at vger dot kernel dot org
- Cc: linux-kernel at vger dot kernel dot org, hpa at zytor dot com, mingo at redhat dot com, mathieu dot desnoyers at efficios dot com, dle-develop at lists dot sourceforge dot net, tglx at linutronix dot de, jbaron at redhat dot com, mhiramat at redhat dot com, mingo at elte dot hu, systemtap at sources dot redhat dot com
- Date: Thu, 4 Mar 2010 16:31:29 GMT
- Subject: [tip:perf/pebs] x86: Issue at least one memory barrier in stop_machine_text_poke()
- Git-commit-id: e5a11016643d1ab7172193591506d33a844734cc
- References: <20100304033850.3819.74590.stgit@localhost6.localdomain6>
- Reply-to: mingo at redhat dot com, hpa at zytor dot com, linux-kernel at vger dot kernel dot org, mathieu dot desnoyers at efficios dot com, dle-develop at lists dot sourceforge dot net, tglx at linutronix dot de, jbaron at redhat dot com, mhiramat at redhat dot com, mingo at elte dot hu, systemtap at sources dot redhat dot com
Commit-ID: e5a11016643d1ab7172193591506d33a844734cc
Gitweb: http://git.kernel.org/tip/e5a11016643d1ab7172193591506d33a844734cc
Author: Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Wed, 3 Mar 2010 22:38:50 -0500
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 4 Mar 2010 11:39:21 +0100
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, and use cpu_relax() for waiting.
Changes in v2:
- Don't use ACCESS_ONCE().
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Jason Baron <jbaron@redhat.com>
LKML-Reference: <20100304033850.3819.74590.stgit@localhost6.localdomain6>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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 c41f13c..e0b8770 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -595,8 +595,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,