From patchwork Mon Feb 25 02:38:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: li guang X-Patchwork-Id: 2179821 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3D082DF24C for ; Mon, 25 Feb 2013 02:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759481Ab3BYCmx (ORCPT ); Sun, 24 Feb 2013 21:42:53 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:39335 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1759438Ab3BYCmw (ORCPT ); Sun, 24 Feb 2013 21:42:52 -0500 X-IronPort-AV: E=Sophos;i="4.84,731,1355068800"; d="scan'208";a="6760669" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 25 Feb 2013 10:37:18 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r1P2dbud010008; Mon, 25 Feb 2013 10:39:37 +0800 Received: from liguang.fnst.cn.fujitsu.com ([10.167.233.147]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013022510384844-376090 ; Mon, 25 Feb 2013 10:38:48 +0800 From: liguang To: tglx@linutronix.de, hpa@zytor.com, pavel@ucw.cz, rjw@sisk.pl, lv.zheng@intel.com, jarkko.sakkinen@intel.com, dave@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, x86@kernel.org Cc: liguang Subject: [rebased-again][PATCH 2/4] numa: avoid export acpi_numa variable Date: Mon, 25 Feb 2013 10:38:35 +0800 Message-Id: <1361759917-5195-3-git-send-email-lig.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1361759917-5195-1-git-send-email-lig.fnst@cn.fujitsu.com> References: <1361759917-5195-1-git-send-email-lig.fnst@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/02/25 10:38:48, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/02/25 10:38:50, Serialize complete at 2013/02/25 10:38:50 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org acpi_numa is used to prevent srat table being parsed, seems a little miss-named, if 'noacpi' was specified by cmdline and CONFIG_ACPI_NUMA was enabled, acpi_numa will be operated directly from everywhere it needed to disable/enable numa in acpi mode which was a bad thing, so, try to export a fuction to get srat table enable/disable info. Acked-by: David Rientjes Signed-off-by: liguang --- arch/x86/include/asm/acpi.h | 2 +- arch/x86/kernel/acpi/srat.c | 21 +++++++++++++-------- arch/x86/mm/numa.c | 2 +- arch/x86/xen/enlighten.c | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index b31bf97..449e12a 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h @@ -177,7 +177,7 @@ static inline void disable_acpi(void) { } #define ARCH_HAS_POWER_INIT 1 #ifdef CONFIG_ACPI_NUMA -extern int acpi_numa; +extern void disable_acpi_numa(void); extern int x86_acpi_numa_init(void); #endif /* CONFIG_ACPI_NUMA */ diff --git a/arch/x86/kernel/acpi/srat.c b/arch/x86/kernel/acpi/srat.c index 459c391..e20baad 100644 --- a/arch/x86/kernel/acpi/srat.c +++ b/arch/x86/kernel/acpi/srat.c @@ -24,22 +24,27 @@ #include #include -int acpi_numa __initdata; +static bool acpi_numa __initdata; static __init int setup_node(int pxm) { return acpi_map_pxm_to_node(pxm); } -static __init void bad_srat(void) +void __init disable_acpi_numa(void) { - printk(KERN_ERR "SRAT: SRAT not used.\n"); - acpi_numa = -1; + acpi_numa = false; } -static __init inline int srat_disabled(void) +static void __init bad_srat(void) { - return acpi_numa < 0; + disable_acpi_numa(); + printk(KERN_ERR "SRAT: SRAT will not be used.\n"); +} + +static bool __init srat_disabled(void) +{ + return acpi_numa == false; } /* Callback for SLIT parsing */ @@ -88,7 +93,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) } set_apicid_to_node(apic_id, node); node_set(node, numa_nodes_parsed); - acpi_numa = 1; + acpi_numa = true; printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n", pxm, apic_id, node); } @@ -130,7 +135,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) set_apicid_to_node(apic_id, node); node_set(node, numa_nodes_parsed); - acpi_numa = 1; + acpi_numa = true; printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n", pxm, apic_id, node); } diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 3545585..62e3b2a 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -47,7 +47,7 @@ static __init int numa_setup(char *opt) #endif #ifdef CONFIG_ACPI_NUMA if (!strncmp(opt, "noacpi", 6)) - acpi_numa = -1; + disable_acpi_numa(); #endif return 0; } diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index bd4c134..724ac84 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -1447,7 +1447,7 @@ asmlinkage void __init xen_start_kernel(void) * any NUMA information the kernel tries to get from ACPI will * be meaningless. Prevent it from trying. */ - acpi_numa = -1; + disable_acpi_numa(); #endif /* Don't do the full vcpu_info placement stuff until we have a