public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] call stop_machine_text_poke() on all cpus
@ 2010-10-28 15:20 Jason Baron
  2010-10-28 16:04 ` Mathieu Desnoyers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jason Baron @ 2010-10-28 15:20 UTC (permalink / raw)
  To: masami.hiramatsu.pt
  Cc: mathieu.desnoyers, hpa, tglx, andi, fweisbec, rostedt, mingo,
	linux-kernel

Currently, text_poke_smp() passes a NULL as the third argument to
__stop_machine(), which will only run stop_machine_text_poke()
on 1 cpu. Change NULL -> cpu_online_mask, as stop_machine_text_poke()
is intended to be run on all cpus.

I actually didn't notice any problems with stop_machine_text_poke()
only being called on 1 cpu, but found this via code inspection.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 arch/x86/kernel/alternative.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 9f39a1c..3c3f26f 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -705,6 +705,6 @@ void *__kprobes text_poke_smp(void *addr, const void *opcode, size_t len)
 	atomic_set(&stop_machine_first, 1);
 	wrote_text = 0;
 	/* Use __stop_machine() because the caller already got online_cpus. */
-	__stop_machine(stop_machine_text_poke, (void *)&tpp, NULL);
+	__stop_machine(stop_machine_text_poke, (void *)&tpp, cpu_online_mask);
 	return addr;
 }
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] call stop_machine_text_poke() on all cpus
  2010-10-28 15:20 [PATCH] call stop_machine_text_poke() on all cpus Jason Baron
@ 2010-10-28 16:04 ` Mathieu Desnoyers
  2010-10-29  4:22 ` Masami Hiramatsu
  2010-10-30  1:10 ` [tip:x86/urgent] x86, alternative: Call " tip-bot for Jason Baron
  2 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2010-10-28 16:04 UTC (permalink / raw)
  To: Jason Baron
  Cc: masami.hiramatsu.pt, hpa, tglx, andi, fweisbec, rostedt, mingo,
	linux-kernel

* Jason Baron (jbaron@redhat.com) wrote:
> Currently, text_poke_smp() passes a NULL as the third argument to
> __stop_machine(), which will only run stop_machine_text_poke()
> on 1 cpu. Change NULL -> cpu_online_mask, as stop_machine_text_poke()
> is intended to be run on all cpus.
> 
> I actually didn't notice any problems with stop_machine_text_poke()
> only being called on 1 cpu, but found this via code inspection.
> 
> Signed-off-by: Jason Baron <jbaron@redhat.com>

Good catch!

The side-effect of this is that the other CPUs are not executing the
memory barrier and not flushing the icache, as we would normally expect.

Thanks,

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

> ---
>  arch/x86/kernel/alternative.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 9f39a1c..3c3f26f 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -705,6 +705,6 @@ void *__kprobes text_poke_smp(void *addr, const void *opcode, size_t len)
>  	atomic_set(&stop_machine_first, 1);
>  	wrote_text = 0;
>  	/* Use __stop_machine() because the caller already got online_cpus. */
> -	__stop_machine(stop_machine_text_poke, (void *)&tpp, NULL);
> +	__stop_machine(stop_machine_text_poke, (void *)&tpp, cpu_online_mask);
>  	return addr;
>  }
> -- 
> 1.7.1
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] call stop_machine_text_poke() on all cpus
  2010-10-28 15:20 [PATCH] call stop_machine_text_poke() on all cpus Jason Baron
  2010-10-28 16:04 ` Mathieu Desnoyers
@ 2010-10-29  4:22 ` Masami Hiramatsu
  2010-10-30  1:10 ` [tip:x86/urgent] x86, alternative: Call " tip-bot for Jason Baron
  2 siblings, 0 replies; 4+ messages in thread
From: Masami Hiramatsu @ 2010-10-29  4:22 UTC (permalink / raw)
  To: Jason Baron
  Cc: mathieu.desnoyers, hpa, tglx, andi, fweisbec, rostedt, mingo,
	linux-kernel, 2nddept-manager

(2010/10/29 0:20), Jason Baron wrote:
> Currently, text_poke_smp() passes a NULL as the third argument to
> __stop_machine(), which will only run stop_machine_text_poke()
> on 1 cpu. Change NULL -> cpu_online_mask, as stop_machine_text_poke()
> is intended to be run on all cpus.

That should be my misunderstand...

> 
> I actually didn't notice any problems with stop_machine_text_poke()
> only being called on 1 cpu, but found this via code inspection.

Thank you very much!

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

> 
> Signed-off-by: Jason Baron <jbaron@redhat.com>
> ---
>  arch/x86/kernel/alternative.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 9f39a1c..3c3f26f 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -705,6 +705,6 @@ void *__kprobes text_poke_smp(void *addr, const void *opcode, size_t len)
>  	atomic_set(&stop_machine_first, 1);
>  	wrote_text = 0;
>  	/* Use __stop_machine() because the caller already got online_cpus. */
> -	__stop_machine(stop_machine_text_poke, (void *)&tpp, NULL);
> +	__stop_machine(stop_machine_text_poke, (void *)&tpp, cpu_online_mask);
>  	return addr;
>  }


-- 
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:x86/urgent] x86, alternative: Call stop_machine_text_poke() on all cpus
  2010-10-28 15:20 [PATCH] call stop_machine_text_poke() on all cpus Jason Baron
  2010-10-28 16:04 ` Mathieu Desnoyers
  2010-10-29  4:22 ` Masami Hiramatsu
@ 2010-10-30  1:10 ` tip-bot for Jason Baron
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Jason Baron @ 2010-10-30  1:10 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, masami.hiramatsu.pt, mathieu.desnoyers,
	jbaron, tglx, hpa

Commit-ID:  404ba5d7bb958d3d788bdaa0debc0bdf60f13ffe
Gitweb:     http://git.kernel.org/tip/404ba5d7bb958d3d788bdaa0debc0bdf60f13ffe
Author:     Jason Baron <jbaron@redhat.com>
AuthorDate: Thu, 28 Oct 2010 11:20:27 -0400
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Fri, 29 Oct 2010 16:42:58 -0700

x86, alternative: Call stop_machine_text_poke() on all cpus

Currently, text_poke_smp() passes a NULL as the third argument to
__stop_machine(), which will only run stop_machine_text_poke()
on 1 cpu. Change NULL -> cpu_online_mask, as stop_machine_text_poke()
is intended to be run on all cpus.

I actually didn't notice any problems with stop_machine_text_poke()
only being called on 1 cpu, but found this via code inspection.

Signed-off-by: Jason Baron <jbaron@redhat.com>
LKML-Reference: <20101028152026.GB2875@redhat.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

---
 arch/x86/kernel/alternative.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index a36bb90..5ceeca3 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -638,7 +638,7 @@ void *__kprobes text_poke_smp(void *addr, const void *opcode, size_t len)
 	atomic_set(&stop_machine_first, 1);
 	wrote_text = 0;
 	/* Use __stop_machine() because the caller already got online_cpus. */
-	__stop_machine(stop_machine_text_poke, (void *)&tpp, NULL);
+	__stop_machine(stop_machine_text_poke, (void *)&tpp, cpu_online_mask);
 	return addr;
 }
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-30  1:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28 15:20 [PATCH] call stop_machine_text_poke() on all cpus Jason Baron
2010-10-28 16:04 ` Mathieu Desnoyers
2010-10-29  4:22 ` Masami Hiramatsu
2010-10-30  1:10 ` [tip:x86/urgent] x86, alternative: Call " tip-bot for Jason Baron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox