summaryrefslogtreecommitdiff
path: root/include/asm-x86/topology.h
diff options
context:
space:
mode:
authorYinghai Lu <Yinghai.Lu@Sun.COM>2008-02-19 03:20:09 -0800
committerIngo Molnar <mingo@elte.hu>2008-04-23 09:01:23 +0200
commit7ddb58ba1ccf9daf5f9b0ef851ee4aea0e5bf7b9 (patch)
treef1c1439a5d3fc834ad14ba079eef0a7e702c72df /include/asm-x86/topology.h
parentaf6fa23ef0a49c26d35cd237f3bd6c901eaa8e66 (diff)
x86: get mp_bus_to_node early
current on amd k8 system with multi ht chain, the numa_node of pci devices under /sys/devices/pci0000:80/* always 0, even that chain is on node 1 or 2 or 3. workaround: pcibus_to_node(bus) is used when we want to get node that pci_device is on. In struct device, we already have numa_node member. and we could use dev_to_node() /set_dev_node() to get and set numa_node in the device. set_dev_node is called in pci_device_add() with pcibus_to_node(bus). and pcibus_to_node use bus->sysdata for nodeid. the problem is when pci_add_device is called, bus->sysdata is not assigned correct nodeid yet. the result will be numa_node always is 0. pcibios_scan_root and pci_scan_root could take sysdata. So we need to get mp_bus_to_node mapping before these two are called. and get_mp_bus_to_node could get correct node for sysdata in root bus. in scanning of root bus, all child bus will take parent bus sysdata. So all pci_device->dev.numa_node will be assigned correctly automatically. later we could use dev_to_node(&pci_dev->dev) to get numa_node, and we could also could make other bus specific device get the correct numa_node too. this is one update version to pci_sysdata and jeff's pci_domain patch. Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/topology.h')
-rw-r--r--include/asm-x86/topology.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index 22073268b481..f0cac2cfa83f 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -198,4 +198,17 @@ extern cpumask_t cpu_coregroup_map(int cpu);
#define smt_capable() (smp_num_siblings > 1)
#endif
+#ifdef CONFIG_NUMA
+int get_mp_bus_to_node(int busnum);
+void set_mp_bus_to_node(int busnum, int node);
+#else
+static inline int get_mp_bus_to_node(int busnum)
+{
+ return 0;
+}
+static inline void set_mp_bus_to_node(int busnum, int node)
+{
+}
+#endif
+
#endif