diff options
-rw-r--r-- | Documentation/kernel-parameters.txt | 6 | ||||
-rw-r--r-- | arch/powerpc/mm/numa.c | 35 |
2 files changed, 40 insertions, 1 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 10d51c2f10d7..c536e1c74320 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -3370,6 +3370,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
3370 | e.g. base its process migration decisions on it. | 3370 | e.g. base its process migration decisions on it. |
3371 | Default is on. | 3371 | Default is on. |
3372 | 3372 | ||
3373 | topology_updates= [KNL, PPC, NUMA] | ||
3374 | Format: {off} | ||
3375 | Specify if the kernel should ignore (off) | ||
3376 | topology updates sent by the hypervisor to this | ||
3377 | LPAR. | ||
3378 | |||
3373 | tp720= [HW,PS2] | 3379 | tp720= [HW,PS2] |
3374 | 3380 | ||
3375 | tpm_suspend_pcr=[HW,TPM] | 3381 | tpm_suspend_pcr=[HW,TPM] |
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 | } |
1154 | early_param("numa", early_numa); | 1156 | early_param("numa", early_numa); |
1155 | 1157 | ||
1158 | static bool topology_updates_enabled = true; | ||
1159 | |||
1160 | static 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 | } | ||
1172 | early_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 | ||
1801 | static int topology_update_init(void) | 1831 | static 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 | ||