From: Andrew Banman <abanman@hpe.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Banman <abanman@hpe.com>,
mingo@redhat.com, tglx@linutronix.de, x86@kernel.org,
linux-kernel@vger.kernel.org, rja@hpe.com, mike.travis@hpe.com
Subject: Re: [PATCH] x86/platform/uv/BAU: disable BAU on single hub configurations
Date: Thu, 20 Jul 2017 13:50:20 -0500 [thread overview]
Message-ID: <20170720185020.GK277355@stormcage.americas.sgi.com> (raw)
In-Reply-To: <20170720114750.mykc2i2cc44m34sp@gmail.com>
On Thu, Jul 20, 2017 at 01:47:50PM +0200, Ingo Molnar wrote:
>
> * 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?
I agree with your suggestions, and I'm happy to make the changes.
>
> 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?
In the case of nobau_perm=1 they can be freed. I will include that in the next
version.
>
> Thanks,
>
> Ingo
Thank you! I'll have the next version out shortly.
Andrew
next prev parent reply other threads:[~2017-07-20 18:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 21:51 Andrew Banman
2017-07-20 11:47 ` Ingo Molnar
2017-07-20 18:50 ` Andrew Banman [this message]
2017-07-20 22:05 ` [PATCH v2] " Andrew Banman
2017-07-21 9:37 ` [tip:x86/urgent] x86/platform/uv/BAU: Disable " tip-bot for Andrew Banman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170720185020.GK277355@stormcage.americas.sgi.com \
--to=abanman@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.travis@hpe.com \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=rja@hpe.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®