diff options
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r-- | arch/powerpc/mm/numa.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 30a42e24bf14..4ebbb9e99286 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1591,6 +1591,20 @@ int arch_update_cpu_topology(void) | |||
1591 | cpu = cpu_last_thread_sibling(cpu); | 1591 | cpu = cpu_last_thread_sibling(cpu); |
1592 | } | 1592 | } |
1593 | 1593 | ||
1594 | /* | ||
1595 | * In cases where we have nothing to update (because the updates list | ||
1596 | * is too short or because the new topology is same as the old one), | ||
1597 | * skip invoking update_cpu_topology() via stop-machine(). This is | ||
1598 | * necessary (and not just a fast-path optimization) since stop-machine | ||
1599 | * can end up electing a random CPU to run update_cpu_topology(), and | ||
1600 | * thus trick us into setting up incorrect cpu-node mappings (since | ||
1601 | * 'updates' is kzalloc()'ed). | ||
1602 | * | ||
1603 | * And for the similar reason, we will skip all the following updating. | ||
1604 | */ | ||
1605 | if (!cpumask_weight(&updated_cpus)) | ||
1606 | goto out; | ||
1607 | |||
1594 | stop_machine(update_cpu_topology, &updates[0], &updated_cpus); | 1608 | stop_machine(update_cpu_topology, &updates[0], &updated_cpus); |
1595 | 1609 | ||
1596 | /* | 1610 | /* |
@@ -1612,6 +1626,7 @@ int arch_update_cpu_topology(void) | |||
1612 | changed = 1; | 1626 | changed = 1; |
1613 | } | 1627 | } |
1614 | 1628 | ||
1629 | out: | ||
1615 | kfree(updates); | 1630 | kfree(updates); |
1616 | return changed; | 1631 | return changed; |
1617 | } | 1632 | } |