x86: remove static boot_cpu_pda array v2
[sfrench/cifs-2.6.git] / arch / x86 / kernel / setup64.c
index aee0e8200777057699f8cd580c1add23684d780d..631ea6cc01d8b868b98ff0b4a190b7563b1262c2 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/bitops.h>
 #include <linux/module.h>
 #include <linux/kgdb.h>
+#include <linux/topology.h>
 #include <asm/pda.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
@@ -34,9 +35,8 @@ struct boot_params boot_params;
 
 cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
 
-struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly;
+struct x8664_pda **_cpu_pda __read_mostly;
 EXPORT_SYMBOL(_cpu_pda);
-struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned;
 
 struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table };
 
@@ -114,8 +114,10 @@ void pda_init(int cpu)
                        __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER);
                if (!pda->irqstackptr)
                        panic("cannot allocate irqstack for cpu %d", cpu); 
-       }
 
+               if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE)
+                       pda->nodenumber = cpu_to_node(cpu);
+       }
 
        pda->irqstackptr += IRQSTACKSIZE-64;
 }