aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Larrew <jlarrew@linux.vnet.ibm.com>2012-06-07 17:04:34 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-09-05 02:05:19 -0400
commit79c5fcebfe4021f326a6715009f0b6b622d5df92 (patch)
tree7ebf15489330161ab74aba15d43bee3f17edc3ce
parent5b716ac728bcc01b1f2a7ed6e437196602237c27 (diff)
powerpc/vphn: Fix arch_update_cpu_topology() return value
arch_update_cpu_topology() should only return 1 when the topology has actually changed, and should return 0 otherwise. This patch fixes a potential bug where rebuild_sched_domains() would reinitialize the sched domains even when the topology hasn't changed. Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/mm/numa.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 39b159751c35..59213cfaeca9 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1436,11 +1436,11 @@ static long vphn_get_associativity(unsigned long cpu,
1436 1436
1437/* 1437/*
1438 * Update the node maps and sysfs entries for each cpu whose home node 1438 * Update the node maps and sysfs entries for each cpu whose home node
1439 * has changed. 1439 * has changed. Returns 1 when the topology has changed, and 0 otherwise.
1440 */ 1440 */
1441int arch_update_cpu_topology(void) 1441int arch_update_cpu_topology(void)
1442{ 1442{
1443 int cpu, nid, old_nid; 1443 int cpu, nid, old_nid, changed = 0;
1444 unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0}; 1444 unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0};
1445 struct device *dev; 1445 struct device *dev;
1446 1446
@@ -1466,9 +1466,10 @@ int arch_update_cpu_topology(void)
1466 dev = get_cpu_device(cpu); 1466 dev = get_cpu_device(cpu);
1467 if (dev) 1467 if (dev)
1468 kobject_uevent(&dev->kobj, KOBJ_CHANGE); 1468 kobject_uevent(&dev->kobj, KOBJ_CHANGE);
1469 changed = 1;
1469 } 1470 }
1470 1471
1471 return 1; 1472 return changed;
1472} 1473}
1473 1474
1474static void topology_work_fn(struct work_struct *work) 1475static void topology_work_fn(struct work_struct *work)