diff options
author | Michael Bringmann <mwb@linux.vnet.ibm.com> | 2017-09-08 16:47:47 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-10-16 08:12:04 -0400 |
commit | cee5405da4020b0b0233bc8fb7c8da7322d2c52e (patch) | |
tree | 7aa1ab90fe1ab627a6dcd01d7114bbd387a0094e | |
parent | a3496e9137f6f58439da29a761725e083229c4a8 (diff) |
powerpc/hotplug: Improve responsiveness of hotplug change
powerpc/hotplug: On Power systems with shared configurations of CPUs
and memory, there are some issues with the association of additional
CPUs and memory to nodes when hot-adding resources. During hotplug
CPU operations, this patch resets the timer on topology update work
function to a small value to better ensure that the CPU topology is
detected and configured sooner.
Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/topology.h | 8 | ||||
-rw-r--r-- | arch/powerpc/mm/numa.c | 23 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 |
3 files changed, 32 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 2d84bca8d053..34da2c5fd1df 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h | |||
@@ -96,6 +96,14 @@ static inline int prrn_is_enabled(void) | |||
96 | } | 96 | } |
97 | #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ | 97 | #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ |
98 | 98 | ||
99 | #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_NEED_MULTIPLE_NODES) | ||
100 | #if defined(CONFIG_PPC_SPLPAR) | ||
101 | extern int timed_topology_update(int nsecs); | ||
102 | #else | ||
103 | #define timed_topology_update(nsecs) | ||
104 | #endif /* CONFIG_PPC_SPLPAR */ | ||
105 | #endif /* CONFIG_HOTPLUG_CPU || CONFIG_NEED_MULTIPLE_NODES */ | ||
106 | |||
99 | #include <asm-generic/topology.h> | 107 | #include <asm-generic/topology.h> |
100 | 108 | ||
101 | #ifdef CONFIG_SMP | 109 | #ifdef CONFIG_SMP |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 5f5ff46ae76d..32f5f8db46ec 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1148,15 +1148,35 @@ struct topology_update_data { | |||
1148 | int new_nid; | 1148 | int new_nid; |
1149 | }; | 1149 | }; |
1150 | 1150 | ||
1151 | #define TOPOLOGY_DEF_TIMER_SECS 60 | ||
1152 | |||
1151 | static u8 vphn_cpu_change_counts[NR_CPUS][MAX_DISTANCE_REF_POINTS]; | 1153 | static u8 vphn_cpu_change_counts[NR_CPUS][MAX_DISTANCE_REF_POINTS]; |
1152 | static cpumask_t cpu_associativity_changes_mask; | 1154 | static cpumask_t cpu_associativity_changes_mask; |
1153 | static int vphn_enabled; | 1155 | static int vphn_enabled; |
1154 | static int prrn_enabled; | 1156 | static int prrn_enabled; |
1155 | static void reset_topology_timer(void); | 1157 | static void reset_topology_timer(void); |
1158 | static int topology_timer_secs = 1; | ||
1156 | static int topology_inited; | 1159 | static int topology_inited; |
1157 | static int topology_update_needed; | 1160 | static int topology_update_needed; |
1158 | 1161 | ||
1159 | /* | 1162 | /* |
1163 | * Change polling interval for associativity changes. | ||
1164 | */ | ||
1165 | int timed_topology_update(int nsecs) | ||
1166 | { | ||
1167 | if (vphn_enabled) { | ||
1168 | if (nsecs > 0) | ||
1169 | topology_timer_secs = nsecs; | ||
1170 | else | ||
1171 | topology_timer_secs = TOPOLOGY_DEF_TIMER_SECS; | ||
1172 | |||
1173 | reset_topology_timer(); | ||
1174 | } | ||
1175 | |||
1176 | return 0; | ||
1177 | } | ||
1178 | |||
1179 | /* | ||
1160 | * Store the current values of the associativity change counters in the | 1180 | * Store the current values of the associativity change counters in the |
1161 | * hypervisor. | 1181 | * hypervisor. |
1162 | */ | 1182 | */ |
@@ -1251,6 +1271,7 @@ static long vphn_get_associativity(unsigned long cpu, | |||
1251 | break; | 1271 | break; |
1252 | case H_SUCCESS: | 1272 | case H_SUCCESS: |
1253 | dbg("VPHN hcall succeeded. Reset polling...\n"); | 1273 | dbg("VPHN hcall succeeded. Reset polling...\n"); |
1274 | timed_topology_update(0); | ||
1254 | break; | 1275 | break; |
1255 | } | 1276 | } |
1256 | 1277 | ||
@@ -1481,7 +1502,7 @@ static struct timer_list topology_timer = | |||
1481 | static void reset_topology_timer(void) | 1502 | static void reset_topology_timer(void) |
1482 | { | 1503 | { |
1483 | topology_timer.data = 0; | 1504 | topology_timer.data = 0; |
1484 | topology_timer.expires = jiffies + 60 * HZ; | 1505 | topology_timer.expires = jiffies + topology_timer_secs * HZ; |
1485 | mod_timer(&topology_timer, topology_timer.expires); | 1506 | mod_timer(&topology_timer, topology_timer.expires); |
1486 | } | 1507 | } |
1487 | 1508 | ||
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index fadb95efbb9e..a7d14aa7bb7c 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -363,6 +363,7 @@ static int dlpar_online_cpu(struct device_node *dn) | |||
363 | BUG_ON(get_cpu_current_state(cpu) | 363 | BUG_ON(get_cpu_current_state(cpu) |
364 | != CPU_STATE_OFFLINE); | 364 | != CPU_STATE_OFFLINE); |
365 | cpu_maps_update_done(); | 365 | cpu_maps_update_done(); |
366 | timed_topology_update(1); | ||
366 | rc = device_online(get_cpu_device(cpu)); | 367 | rc = device_online(get_cpu_device(cpu)); |
367 | if (rc) | 368 | if (rc) |
368 | goto out; | 369 | goto out; |
@@ -533,6 +534,7 @@ static int dlpar_offline_cpu(struct device_node *dn) | |||
533 | set_preferred_offline_state(cpu, | 534 | set_preferred_offline_state(cpu, |
534 | CPU_STATE_OFFLINE); | 535 | CPU_STATE_OFFLINE); |
535 | cpu_maps_update_done(); | 536 | cpu_maps_update_done(); |
537 | timed_topology_update(1); | ||
536 | rc = device_offline(get_cpu_device(cpu)); | 538 | rc = device_offline(get_cpu_device(cpu)); |
537 | if (rc) | 539 | if (rc) |
538 | goto out; | 540 | goto out; |