aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 51d707d85b2d..177659050fa0 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -8,6 +8,8 @@
8 * as published by the Free Software Foundation; either version 8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11#define pr_fmt(fmt) "numa: " fmt
12
11#include <linux/threads.h> 13#include <linux/threads.h>
12#include <linux/bootmem.h> 14#include <linux/bootmem.h>
13#include <linux/init.h> 15#include <linux/init.h>
@@ -1153,6 +1155,22 @@ static int __init early_numa(char *p)
1153} 1155}
1154early_param("numa", early_numa); 1156early_param("numa", early_numa);
1155 1157
1158static bool topology_updates_enabled = true;
1159
1160static int __init early_topology_updates(char *p)
1161{
1162 if (!p)
1163 return 0;
1164
1165 if (!strcmp(p, "off")) {
1166 pr_info("Disabling topology updates\n");
1167 topology_updates_enabled = false;
1168 }
1169
1170 return 0;
1171}
1172early_param("topology_updates", early_topology_updates);
1173
1156#ifdef CONFIG_MEMORY_HOTPLUG 1174#ifdef CONFIG_MEMORY_HOTPLUG
1157/* 1175/*
1158 * Find the node associated with a hot added memory section for 1176 * Find the node associated with a hot added memory section for
@@ -1539,6 +1557,9 @@ int arch_update_cpu_topology(void)
1539 struct device *dev; 1557 struct device *dev;
1540 int weight, new_nid, i = 0; 1558 int weight, new_nid, i = 0;
1541 1559
1560 if (!prrn_enabled && !vphn_enabled)
1561 return 0;
1562
1542 weight = cpumask_weight(&cpu_associativity_changes_mask); 1563 weight = cpumask_weight(&cpu_associativity_changes_mask);
1543 if (!weight) 1564 if (!weight)
1544 return 0; 1565 return 0;
@@ -1592,6 +1613,15 @@ int arch_update_cpu_topology(void)
1592 cpu = cpu_last_thread_sibling(cpu); 1613 cpu = cpu_last_thread_sibling(cpu);
1593 } 1614 }
1594 1615
1616 pr_debug("Topology update for the following CPUs:\n");
1617 if (cpumask_weight(&updated_cpus)) {
1618 for (ud = &updates[0]; ud; ud = ud->next) {
1619 pr_debug("cpu %d moving from node %d "
1620 "to %d\n", ud->cpu,
1621 ud->old_nid, ud->new_nid);
1622 }
1623 }
1624
1595 /* 1625 /*
1596 * In cases where we have nothing to update (because the updates list 1626 * In cases where we have nothing to update (because the updates list
1597 * is too short or because the new topology is same as the old one), 1627 * is too short or because the new topology is same as the old one),
@@ -1800,7 +1830,10 @@ static const struct file_operations topology_ops = {
1800 1830
1801static int topology_update_init(void) 1831static int topology_update_init(void)
1802{ 1832{
1803 start_topology_update(); 1833 /* Do not poll for changes if disabled at boot */
1834 if (topology_updates_enabled)
1835 start_topology_update();
1836
1804 if (!proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops)) 1837 if (!proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops))
1805 return -ENOMEM; 1838 return -ENOMEM;
1806 1839