Re: [PATCH 3/4] x86_64: Fold pda into per cpu area

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Saturday, February 16, 2008 - 11:22 pm

On Feb 15, 2008 12:16 PM, Ingo Molnar <mingo@elte.hu> wrote:

this patch need to apply to mainline asap.

or you need revert to the patch about include/asm-x86/percpu.h

+#ifdef CONFIG_X86_64
+#include <linux/compiler.h>
+
+/* Same as asm-generic/percpu.h, except that we store the per cpu offset
+   in the PDA. Longer term the PDA and every per cpu variable
+   should be just put into a single section and referenced directly
+   from %gs */
+
+#ifdef CONFIG_SMP
+#include <asm/pda.h>
+
+#define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset)
+#define __my_cpu_offset read_pda(data_offset)
+
+#define per_cpu_offset(x) (__per_cpu_offset(x))
+
 #endif
+#include <asm-generic/percpu.h>
+
+DECLARE_PER_CPU(struct x8664_pda, pda);
+
+#else /* CONFIG_X86_64 */

because current tree
in setup_per_cpu_areas will have
     cpu_pda(i)->data_offset = ptr - __per_cpu_start;

but at that time all APs will use cpu_pda for boot cpu...,and APs will
get their pda in do_boot_cpu()

the result is all cpu will have same data_offset, there will share one
per_cpu_data..that is totally wrong!!

that could explain a lot of strange panic ....recently about NUMA...

YH
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/4] x86_64: Fold pda into per cpu area, travis, (Fri Feb 1, 12:14 pm)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Ingo Molnar, (Fri Feb 15, 1:16 pm)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Christoph Lameter, (Fri Feb 15, 3:43 pm)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Yinghai Lu, (Sat Feb 16, 11:22 pm)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Yinghai Lu, (Sun Feb 17, 12:36 am)