diff options
author | Andrew Banman <abanman@hpe.com> | 2017-07-20 18:05:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-07-21 03:56:25 -0400 |
commit | 2fe9a5c6ade4dfb53ff1c137cca3828d9d1d0948 (patch) | |
tree | 38f1f1c2fd93e1bc6d04a9211748536b58a390cd | |
parent | 0bc73048d7baecf94117d1a948853a627e6ba5c8 (diff) |
x86/platform/uv/BAU: Disable BAU on single hub configurations
The BAU confers no benefit to a UV system running with only one hub/socket.
Permanently disable the BAU driver if there are less than two hubs online
to avoid BAU overhead. We have observed failed boots on single-socket UV4
systems caused by BAU that are avoided with this patch.
Also, while at it, consolidate initialization error blocks and fix a
memory leak.
Signed-off-by: Andrew Banman <abanman@hpe.com>
Acked-by: Russ Anderson <rja@hpe.com>
Acked-by: Mike Travis <mike.travis@hpe.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: tony.ernst@hpe.com
Link: http://lkml.kernel.org/r/1500588351-78016-1-git-send-email-abanman@hpe.com
[ Minor cleanups. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/platform/uv/tlb_uv.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index fd8759111b65..3e4bdb442fbc 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c | |||
@@ -2221,13 +2221,17 @@ static int __init uv_bau_init(void) | |||
2221 | else if (is_uv1_hub()) | 2221 | else if (is_uv1_hub()) |
2222 | ops = uv1_bau_ops; | 2222 | ops = uv1_bau_ops; |
2223 | 2223 | ||
2224 | nuvhubs = uv_num_possible_blades(); | ||
2225 | if (nuvhubs < 2) { | ||
2226 | pr_crit("UV: BAU disabled - insufficient hub count\n"); | ||
2227 | goto err_bau_disable; | ||
2228 | } | ||
2229 | |||
2224 | for_each_possible_cpu(cur_cpu) { | 2230 | for_each_possible_cpu(cur_cpu) { |
2225 | mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); | 2231 | mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); |
2226 | zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); | 2232 | zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); |
2227 | } | 2233 | } |
2228 | 2234 | ||
2229 | nuvhubs = uv_num_possible_blades(); | ||
2230 | |||
2231 | uv_base_pnode = 0x7fffffff; | 2235 | uv_base_pnode = 0x7fffffff; |
2232 | for (uvhub = 0; uvhub < nuvhubs; uvhub++) { | 2236 | for (uvhub = 0; uvhub < nuvhubs; uvhub++) { |
2233 | cpus = uv_blade_nr_possible_cpus(uvhub); | 2237 | cpus = uv_blade_nr_possible_cpus(uvhub); |
@@ -2240,9 +2244,8 @@ static int __init uv_bau_init(void) | |||
2240 | enable_timeouts(); | 2244 | enable_timeouts(); |
2241 | 2245 | ||
2242 | if (init_per_cpu(nuvhubs, uv_base_pnode)) { | 2246 | if (init_per_cpu(nuvhubs, uv_base_pnode)) { |
2243 | set_bau_off(); | 2247 | pr_crit("UV: BAU disabled - per CPU init failed\n"); |
2244 | nobau_perm = 1; | 2248 | goto err_bau_disable; |
2245 | return 0; | ||
2246 | } | 2249 | } |
2247 | 2250 | ||
2248 | vector = UV_BAU_MESSAGE; | 2251 | vector = UV_BAU_MESSAGE; |
@@ -2268,6 +2271,16 @@ static int __init uv_bau_init(void) | |||
2268 | } | 2271 | } |
2269 | 2272 | ||
2270 | return 0; | 2273 | return 0; |
2274 | |||
2275 | err_bau_disable: | ||
2276 | |||
2277 | for_each_possible_cpu(cur_cpu) | ||
2278 | free_cpumask_var(per_cpu(uv_flush_tlb_mask, cur_cpu)); | ||
2279 | |||
2280 | set_bau_off(); | ||
2281 | nobau_perm = 1; | ||
2282 | |||
2283 | return -EINVAL; | ||
2271 | } | 2284 | } |
2272 | core_initcall(uv_bau_init); | 2285 | core_initcall(uv_bau_init); |
2273 | fs_initcall(uv_ptc_init); | 2286 | fs_initcall(uv_ptc_init); |