Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1692842
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] x86/platform/uv/BAU: disable BAU on single hub configurations |
| Date | 2017-07-20 13:50 +0200 |
| Message-ID | <u5i7U-6Lf-13@gated-at.bofh.it> (permalink) |
| References | <u4IQN-86Q-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* Andrew Banman <abanman@hpe.com> wrote:
> 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.
>
> Signed-off-by: Andrew Banman <abanman@hpe.com>
> Acked-by: Russ Anderson <rja@hpe.com>
> Acked-by: Mike Travis <mike.travis@hpe.com>
> ---
> arch/x86/platform/uv/tlb_uv.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
> index 2511a28..88216cc 100644
> --- a/arch/x86/platform/uv/tlb_uv.c
> +++ b/arch/x86/platform/uv/tlb_uv.c
> @@ -2251,6 +2251,12 @@ static int __init uv_bau_init(void)
> }
>
> nuvhubs = uv_num_possible_blades();
> + if (nuvhubs < 2) {
> + pr_crit("UV: BAU disabled - insufficient hub count\n");
> + set_bau_off();
> + nobau_perm = 1;
> + return 0;
> + }
Yeah, could you structure the error paths in this function in a bit more organized
fashion? It has two similar error handling blocks:
pr_crit("UV: BAU disabled - insufficient hub count\n");
set_bau_off();
nobau_perm = 1;
return 0;
...
set_bau_off();
nobau_perm = 1;
return 0;
which could be consolidated via the usual goto exception construct:
if (nuvhubs < 2) {
pr_crit("UV: BAU disabled - insufficient hub count\n");
goto err_disable_bau;
}
...
if (init_per_cpu(nuvhubs, uv_base_pnode))
pr_crit("UV: BAU disabled - per CPU init failed\n");
goto err_disable_bau;
}
...
return 0;
err_disable_bau:
set_bau_off();
nobau_perm = 1;
return 0;
Note that I added an error message to the second case as well.
Plus, in the error case you might want to use a 'return -EINVAL;' instead of
return 0, or so?
Plus plus, there's probably a (mild) memory leak in the error paths, can the
cpumasks be free_cpumask_var() freed - or are they still required even if BAU is
disabled?
Thanks,
Ingo
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] x86/platform/uv/BAU: disable BAU on single hub configurations Andrew Banman <abanman@hpe.com> - 2017-07-19 00:10 +0200
Re: [PATCH] x86/platform/uv/BAU: disable BAU on single hub configurations Ingo Molnar <mingo@kernel.org> - 2017-07-20 13:50 +0200
Re: [PATCH] x86/platform/uv/BAU: disable BAU on single hub configurations Andrew Banman <abanman@hpe.com> - 2017-07-20 21:00 +0200
[PATCH v2] x86/platform/uv/BAU: disable BAU on single hub configurations Andrew Banman <abanman@hpe.com> - 2017-07-21 00:10 +0200
[tip:x86/urgent] x86/platform/uv/BAU: Disable BAU on single hub configurations tip-bot for Andrew Banman <tipbot@zytor.com> - 2017-07-21 11:50 +0200
csiph-web