Skip to content

Commit

Permalink
x86/platform/uv/BAU: Disable BAU on single hub configurations
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Russ Anderson <[email protected]>
Acked-by: Mike Travis <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
[ Minor cleanups. ]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Andrew Banman authored and Ingo Molnar committed Jul 21, 2017
1 parent 0bc7304 commit 2fe9a5c
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions arch/x86/platform/uv/tlb_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,13 +2221,17 @@ static int __init uv_bau_init(void)
else if (is_uv1_hub())
ops = uv1_bau_ops;

nuvhubs = uv_num_possible_blades();
if (nuvhubs < 2) {
pr_crit("UV: BAU disabled - insufficient hub count\n");
goto err_bau_disable;
}

for_each_possible_cpu(cur_cpu) {
mask = &per_cpu(uv_flush_tlb_mask, cur_cpu);
zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu));
}

nuvhubs = uv_num_possible_blades();

uv_base_pnode = 0x7fffffff;
for (uvhub = 0; uvhub < nuvhubs; uvhub++) {
cpus = uv_blade_nr_possible_cpus(uvhub);
Expand All @@ -2240,9 +2244,8 @@ static int __init uv_bau_init(void)
enable_timeouts();

if (init_per_cpu(nuvhubs, uv_base_pnode)) {
set_bau_off();
nobau_perm = 1;
return 0;
pr_crit("UV: BAU disabled - per CPU init failed\n");
goto err_bau_disable;
}

vector = UV_BAU_MESSAGE;
Expand All @@ -2268,6 +2271,16 @@ static int __init uv_bau_init(void)
}

return 0;

err_bau_disable:

for_each_possible_cpu(cur_cpu)
free_cpumask_var(per_cpu(uv_flush_tlb_mask, cur_cpu));

set_bau_off();
nobau_perm = 1;

return -EINVAL;
}
core_initcall(uv_bau_init);
fs_initcall(uv_ptc_init);

0 comments on commit 2fe9a5c

Please sign in to comment.