public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Masami Hiramatsu <mhiramat@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	mathieu.desnoyers@efficios.com,
	dle-develop@lists.sourceforge.net, tglx@linutronix.de,
	jbaron@redhat.com, mhiramat@redhat.com, mingo@elte.hu,
	systemtap@sources.redhat.com
Subject: [tip:perf/pebs] x86: Issue at least one memory barrier in stop_machine_text_poke()
Date: Thu, 4 Mar 2010 16:31:29 GMT	[thread overview]
Message-ID: <tip-e5a11016643d1ab7172193591506d33a844734cc@git.kernel.org> (raw)
In-Reply-To: <20100304033850.3819.74590.stgit@localhost6.localdomain6>

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,

  reply	other threads:[~2010-03-04 16:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04  3:38 [PATCH -tip v2 1/2] perf probe: Correct probe syntax on command line help Masami Hiramatsu
2010-03-04  3:38 ` [PATCH -tip v2 2/2] x86: Issue at least one memory barrier in stop_machine_text_poke() Masami Hiramatsu
2010-03-04 16:31   ` tip-bot for Masami Hiramatsu [this message]
2010-03-04 16:31 ` [tip:perf/pebs] perf probe: Correct probe syntax on command line help tip-bot for Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-e5a11016643d1ab7172193591506d33a844734cc@git.kernel.org \
    --to=mhiramat@redhat.com \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=hpa@zytor.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=systemtap@sources.redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox