Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754240AbdGUJm0 (ORCPT ); Fri, 21 Jul 2017 05:42:26 -0400 Received: from terminus.zytor.com ([65.50.211.136]:45185 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753743AbdGUJmY (ORCPT ); Fri, 21 Jul 2017 05:42:24 -0400 Date: Fri, 21 Jul 2017 02:37:53 -0700 From: tip-bot for Andrew Banman Message-ID: Cc: peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, mike.travis@hpe.com, rja@hpe.com, abanman@hpe.com Reply-To: mingo@kernel.org, torvalds@linux-foundation.org, peterz@infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, abanman@hpe.com, hpa@zytor.com, mike.travis@hpe.com, rja@hpe.com In-Reply-To: <1500588351-78016-1-git-send-email-abanman@hpe.com> References: <1500588351-78016-1-git-send-email-abanman@hpe.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/platform/uv/BAU: Disable BAU on single hub configurations Git-Commit-ID: 2fe9a5c6ade4dfb53ff1c137cca3828d9d1d0948 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2633 Lines: 84 Commit-ID: 2fe9a5c6ade4dfb53ff1c137cca3828d9d1d0948 Gitweb: http://git.kernel.org/tip/2fe9a5c6ade4dfb53ff1c137cca3828d9d1d0948 Author: Andrew Banman AuthorDate: Thu, 20 Jul 2017 17:05:51 -0500 Committer: Ingo Molnar CommitDate: Fri, 21 Jul 2017 09:56:25 +0200 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 Acked-by: Russ Anderson Acked-by: Mike Travis Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner 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 --- arch/x86/platform/uv/tlb_uv.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index fd87591..3e4bdb4 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) 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); @@ -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; @@ -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);