aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorAndreas Herrmann <andreas.herrmann3@amd.com>2009-04-17 06:01:55 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-11-06 17:09:15 -0500
commite0cd5160346f5b88fe536f529066f102518f8acd (patch)
treed6c2ffc944c9ee0d4215287d3b416f2e9712dc10 /drivers/pci/pci-sysfs.c
parentea7f1b6ee9dc96c5827b06ba21d7769d553efb7d (diff)
PCI: derive nearby CPUs from device's instead of bus' NUMA information
In case of AMD CPU northbridge functions this NUMA information might differ. Here is an example from a 4-socket system. Currently Linux shows root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat numa_node 0 root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat local_cpu* 0-3 00000000,0000000f which is not correct for northbridge functions as the local CPUs are those of the same socket. With this patch and a quirk for AMD CPU NB functions Linux can do better and correctly show root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat numa_node 2 root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat local_cpu* 8-11 00000000,00000f00 Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 0f6382f090ee..0fa707e2a0f8 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -74,7 +74,11 @@ static ssize_t local_cpus_show(struct device *dev,
74 const struct cpumask *mask; 74 const struct cpumask *mask;
75 int len; 75 int len;
76 76
77#ifdef CONFIG_NUMA
78 mask = cpumask_of_node(dev_to_node(dev));
79#else
77 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); 80 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
81#endif
78 len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); 82 len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
79 buf[len++] = '\n'; 83 buf[len++] = '\n';
80 buf[len] = '\0'; 84 buf[len] = '\0';
@@ -88,7 +92,11 @@ static ssize_t local_cpulist_show(struct device *dev,
88 const struct cpumask *mask; 92 const struct cpumask *mask;
89 int len; 93 int len;
90 94
95#ifdef CONFIG_NUMA
96 mask = cpumask_of_node(dev_to_node(dev));
97#else
91 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); 98 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
99#endif
92 len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask); 100 len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask);
93 buf[len++] = '\n'; 101 buf[len++] = '\n';
94 buf[len] = '\0'; 102 buf[len] = '\0';