From 8183833bb4b48fdb150f64905b80fd21045946ec Mon Sep 17 00:00:00 2001 From: KOSAKI Motohiro Date: Thu, 21 Apr 2011 10:32:57 +0900 Subject: [PATCH 1/2] Revert "x86, NUMA: Fix fakenuma boot failure" This reverts commit 7d6b46707f2491a94f4bd3b4329d2d7f809e9368. Andreas Herrmann reported the patch breaks AMD Mangy-Cours because Magny-Cours has two nodes in the same physical package. He said, :With this patch Linux shows : : root # numactl --hardware : available: 8 nodes (0-7) : node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 : node 0 size: 8189 MB : node 0 free: 7937 MB : node 1 cpus: : node 1 size: 16384 MB : node 1 free: 16129 MB : node 2 cpus: 12 13 14 15 16 17 18 19 20 21 22 23 : node 2 size: 8192 MB : node 2 free: 8024 MB : node 3 cpus: : node 3 size: 16384 MB : node 3 free: 16129 MB : node 4 cpus: 24 25 26 27 28 29 30 31 32 33 34 35 : node 4 size: 8192 MB : node 4 free: 8013 MB : node 5 cpus: : node 5 size: 16384 MB : node 5 free: 16129 MB : node 6 cpus: 36 37 38 39 40 41 42 43 44 45 46 47 : node 6 size: 8192 MB : node 6 free: 8025 MB : node 7 cpus: : node 7 size: 16384 MB : node 7 free: 16128 MB : node distances: : node 0 1 2 3 4 5 6 7 : 0: 10 16 16 22 16 22 16 22 : 1: 16 10 22 16 16 22 22 16 : 2: 16 22 10 16 16 16 16 16 : 3: 22 16 16 10 16 16 22 22 : 4: 16 16 16 16 10 16 16 22 : 5: 22 22 16 16 16 10 22 16 : 6: 16 22 16 22 16 22 10 16 : 7: 22 16 16 22 22 16 16 10 : :which is bogus. The correct NUMA-information (based on SRAT) (w/o this :patch) is : : linux # numactl --hardware : available: 8 nodes (0-7) : node 0 cpus: 0 1 2 3 4 5 : node 0 size: 8189 MB : node 0 free: 7947 MB : node 1 cpus: 6 7 8 9 10 11 : node 1 size: 16384 MB : node 1 free: 16114 MB : node 2 cpus: 12 13 14 15 16 17 : node 2 size: 8192 MB : node 2 free: 7941 MB : node 3 cpus: 18 19 20 21 22 23 : node 3 size: 16384 MB : node 3 free: 16120 MB : node 4 cpus: 24 25 26 27 28 29 : node 4 size: 8192 MB : node 4 free: 8028 MB : node 5 cpus: 30 31 32 33 34 35 : node 5 size: 16384 MB : node 5 free: 16116 MB : node 6 cpus: 36 37 38 39 40 41 : node 6 size: 8192 MB : node 6 free: 8033 MB : node 7 cpus: 42 43 44 45 46 47 : node 7 size: 16384 MB : node 7 free: 16120 MB : node distances: : node 0 1 2 3 4 5 6 7 : 0: 10 16 16 22 16 22 16 22 : 1: 16 10 22 16 16 22 22 16 : 2: 16 22 10 16 16 16 16 16 : 3: 22 16 16 10 16 16 22 22 : 4: 16 16 16 16 10 16 16 22 : 5: 22 22 16 16 16 10 22 16 : 6: 16 22 16 22 16 22 10 16 : 7: 22 16 16 22 22 16 16 10 We need another and less intrusive patch. Signed-off-by: KOSAKI Motohiro --- arch/x86/kernel/smpboot.c | 23 ----------------------- 1 files changed, 0 insertions(+), 23 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 8ed8908..c2871d3 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -312,26 +312,6 @@ void __cpuinit smp_store_cpu_info(int id) identify_secondary_cpu(c); } -static void __cpuinit check_cpu_siblings_on_same_node(int cpu1, int cpu2) -{ - int node1 = early_cpu_to_node(cpu1); - int node2 = early_cpu_to_node(cpu2); - - /* - * Our CPU scheduler assumes all logical cpus in the same physical cpu - * share the same node. But, buggy ACPI or NUMA emulation might assign - * them to different node. Fix it. - */ - if (node1 != node2) { - pr_warning("CPU %d in node %d and CPU %d in node %d are in the same physical CPU. forcing same node %d\n", - cpu1, node1, cpu2, node2, node2); - - numa_remove_cpu(cpu1); - numa_set_node(cpu1, node2); - numa_add_cpu(cpu1); - } -} - static void __cpuinit link_thread_siblings(int cpu1, int cpu2) { cpumask_set_cpu(cpu1, cpu_sibling_mask(cpu2)); @@ -340,7 +320,6 @@ static void __cpuinit link_thread_siblings(int cpu1, int cpu2) cpumask_set_cpu(cpu2, cpu_core_mask(cpu1)); cpumask_set_cpu(cpu1, cpu_llc_shared_mask(cpu2)); cpumask_set_cpu(cpu2, cpu_llc_shared_mask(cpu1)); - check_cpu_siblings_on_same_node(cpu1, cpu2); } @@ -382,12 +361,10 @@ void __cpuinit set_cpu_sibling_map(int cpu) per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) { cpumask_set_cpu(i, cpu_llc_shared_mask(cpu)); cpumask_set_cpu(cpu, cpu_llc_shared_mask(i)); - check_cpu_siblings_on_same_node(cpu, i); } if (c->phys_proc_id == cpu_data(i).phys_proc_id) { cpumask_set_cpu(i, cpu_core_mask(cpu)); cpumask_set_cpu(cpu, cpu_core_mask(i)); - check_cpu_siblings_on_same_node(cpu, i); /* * Does this new cpu bringup a new core? */ -- 1.7.3.1