Skip to content

Commit

Permalink
powerpc/vphn: Fix arch_update_cpu_topology() return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesse Larrew authored and Benjamin Herrenschmidt committed Sep 5, 2012
1 parent 5b716ac commit 79c5fce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,11 +1436,11 @@ static long vphn_get_associativity(unsigned long cpu,

/*
* Update the node maps and sysfs entries for each cpu whose home node
* has changed.
* has changed. Returns 1 when the topology has changed, and 0 otherwise.
*/
int arch_update_cpu_topology(void)
{
int cpu, nid, old_nid;
int cpu, nid, old_nid, changed = 0;
unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0};
struct device *dev;

Expand All @@ -1466,9 +1466,10 @@ int arch_update_cpu_topology(void)
dev = get_cpu_device(cpu);
if (dev)
kobject_uevent(&dev->kobj, KOBJ_CHANGE);
changed = 1;
}

return 1;
return changed;
}

static void topology_work_fn(struct work_struct *work)
Expand Down

0 comments on commit 79c5fce

Please sign in to comment.