diff options
author | Yinghai Lu <Yinghai.Lu@Sun.COM> | 2008-02-19 06:20:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-26 17:41:04 -0400 |
commit | 871d5f8dd0f7647f03facd4cb79485938d1b61ab (patch) | |
tree | b08eee02ddd7b4bdb9dfde2637f5154e409cdacc /include/asm-x86 | |
parent | bb63b4219976d48ed6d22ac33c18be334fb5a78c (diff) |
x86: get mp_bus_to_node early
Currently, on an amd k8 system with multi ht chains, the numa_node of
pci devices under /sys/devices/pci0000:80/* is always 0, even if that
chain is on node 1 or 2 or 3.
Workaround: pcibus_to_node(bus) is used when we want to get the 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 uses bus->sysdata for nodeid.
The problem is when pci_add_device is called, bus->sysdata is not assigned
correct nodeid yet. The result is that numa_node will always be 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 thus
get_mp_bus_to_node could get correct node for sysdata in root bus.
In scanning of the root bus, all child busses will take parent bus sysdata.
So all pci_device->dev.numa_node will be assigned correctly and 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 an updated version of pci_sysdata and Jeff's pci_domain patch.
[ mingo@elte.hu: build fix ]
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')
-rw-r--r-- | include/asm-x86/pci.h | 2 | ||||
-rw-r--r-- | include/asm-x86/topology.h | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-x86/pci.h b/include/asm-x86/pci.h index ddd8e248fc0a..30bbde0cb34b 100644 --- a/include/asm-x86/pci.h +++ b/include/asm-x86/pci.h | |||
@@ -19,6 +19,8 @@ struct pci_sysdata { | |||
19 | }; | 19 | }; |
20 | 20 | ||
21 | /* scan a bus after allocating a pci_sysdata for it */ | 21 | /* scan a bus after allocating a pci_sysdata for it */ |
22 | extern struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, | ||
23 | int node); | ||
22 | extern struct pci_bus *pci_scan_bus_with_sysdata(int busno); | 24 | extern struct pci_bus *pci_scan_bus_with_sysdata(int busno); |
23 | 25 | ||
24 | static inline int pci_domain_nr(struct pci_bus *bus) | 26 | static inline int pci_domain_nr(struct pci_bus *bus) |
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h index 22073268b481..4793ae745a78 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); | |||
198 | #define smt_capable() (smp_num_siblings > 1) | 198 | #define smt_capable() (smp_num_siblings > 1) |
199 | #endif | 199 | #endif |
200 | 200 | ||
201 | #ifdef CONFIG_NUMA | ||
202 | extern int get_mp_bus_to_node(int busnum); | ||
203 | extern void set_mp_bus_to_node(int busnum, int node); | ||
204 | #else | ||
205 | static inline int get_mp_bus_to_node(int busnum) | ||
206 | { | ||
207 | return 0; | ||
208 | } | ||
209 | static inline void set_mp_bus_to_node(int busnum, int node) | ||
210 | { | ||
211 | } | ||
212 | #endif | ||
213 | |||
201 | #endif | 214 | #endif |