All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Don't copy per_cpu cpuinfo for BSP two times
@ 2011-01-21 23:29 Yinghai Lu
  2011-01-22 11:13 ` Borislav Petkov
  2011-01-26 10:59 ` [tip:x86/cpu] " tip-bot for Yinghai Lu
  0 siblings, 2 replies; 3+ messages in thread
From: Yinghai Lu @ 2011-01-21 23:29 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Suresh Siddha, Tejun Heo, Borislav Petkov, linux-kernel


smp_store_cpu_info(0) will do that.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/smpboot.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/x86/kernel/smpboot.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/smpboot.c
+++ linux-2.6/arch/x86/kernel/smpboot.c
@@ -1071,13 +1071,13 @@ void __init native_smp_prepare_cpus(unsi
 
 	preempt_disable();
 	smp_cpu_index_default();
-	memcpy(__this_cpu_ptr(&cpu_info), &boot_cpu_data, sizeof(cpu_info));
-	cpumask_copy(cpu_callin_mask, cpumask_of(0));
-	mb();
+
 	/*
 	 * Setup boot CPU information
 	 */
 	smp_store_cpu_info(0); /* Final full version of the data */
+	cpumask_copy(cpu_callin_mask, cpumask_of(0));
+	mb();
 #ifdef CONFIG_X86_32
 	boot_cpu_logical_apicid = logical_smp_processor_id();
 #endif

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

* Re: [PATCH] x86: Don't copy per_cpu cpuinfo for BSP two times
  2011-01-21 23:29 [PATCH] x86: Don't copy per_cpu cpuinfo for BSP two times Yinghai Lu
@ 2011-01-22 11:13 ` Borislav Petkov
  2011-01-26 10:59 ` [tip:x86/cpu] " tip-bot for Yinghai Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2011-01-22 11:13 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Suresh Siddha,
	Tejun Heo, linux-kernel

On Fri, Jan 21, 2011 at 03:29:54PM -0800, Yinghai Lu wrote:
> 
> smp_store_cpu_info(0) will do that.
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> ---
>  arch/x86/kernel/smpboot.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6/arch/x86/kernel/smpboot.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/smpboot.c
> +++ linux-2.6/arch/x86/kernel/smpboot.c
> @@ -1071,13 +1071,13 @@ void __init native_smp_prepare_cpus(unsi
>  
>  	preempt_disable();
>  	smp_cpu_index_default();
> -	memcpy(__this_cpu_ptr(&cpu_info), &boot_cpu_data, sizeof(cpu_info));
> -	cpumask_copy(cpu_callin_mask, cpumask_of(0));
> -	mb();
> +
>  	/*
>  	 * Setup boot CPU information
>  	 */
>  	smp_store_cpu_info(0); /* Final full version of the data */
> +	cpumask_copy(cpu_callin_mask, cpumask_of(0));
> +	mb();

Question: why do we need the memory barrier there? We're running on the
BSP and long before smp_init() to be all careful about the callin_mask.
It could be there as a left over from the 32 and 64-bit merge, AFAICT
from git history...

Thanks.

-- 
Regards/Gruss,
    Boris.

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

* [tip:x86/cpu] x86: Don't copy per_cpu cpuinfo for BSP two times
  2011-01-21 23:29 [PATCH] x86: Don't copy per_cpu cpuinfo for BSP two times Yinghai Lu
  2011-01-22 11:13 ` Borislav Petkov
@ 2011-01-26 10:59 ` tip-bot for Yinghai Lu
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Yinghai Lu @ 2011-01-26 10:59 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, bp, suresh.b.siddha, tj, tglx, mingo

Commit-ID:  792363d2beceb1c7d865e517fa9939c8b8c1442a
Gitweb:     http://git.kernel.org/tip/792363d2beceb1c7d865e517fa9939c8b8c1442a
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Fri, 21 Jan 2011 15:29:54 -0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 26 Jan 2011 08:44:50 +0100

x86: Don't copy per_cpu cpuinfo for BSP two times

smp_store_cpu_info(0) will do that.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
LKML-Reference: <4D3A16F2.5090902@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/smpboot.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index d396155..a7a3d1a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1071,13 +1071,13 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 
 	preempt_disable();
 	smp_cpu_index_default();
-	memcpy(__this_cpu_ptr(&cpu_info), &boot_cpu_data, sizeof(cpu_info));
-	cpumask_copy(cpu_callin_mask, cpumask_of(0));
-	mb();
+
 	/*
 	 * Setup boot CPU information
 	 */
 	smp_store_cpu_info(0); /* Final full version of the data */
+	cpumask_copy(cpu_callin_mask, cpumask_of(0));
+	mb();
 #ifdef CONFIG_X86_32
 	boot_cpu_logical_apicid = logical_smp_processor_id();
 #endif

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

end of thread, other threads:[~2011-01-26 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-21 23:29 [PATCH] x86: Don't copy per_cpu cpuinfo for BSP two times Yinghai Lu
2011-01-22 11:13 ` Borislav Petkov
2011-01-26 10:59 ` [tip:x86/cpu] " tip-bot for Yinghai Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.