Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765522Ab3DDXsG (ORCPT ); Thu, 4 Apr 2013 19:48:06 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:43410 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765153Ab3DDXr6 (ORCPT ); Thu, 4 Apr 2013 19:47:58 -0400 From: Yinghai Lu To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Morton , Tejun Heo , Thomas Renninger , Tang Chen Cc: linux-kernel@vger.kernel.org, Yinghai Lu Subject: [PATCH v3 15/22] x86, mm, numa: Move node_possible_map setting later Date: Thu, 4 Apr 2013 16:46:19 -0700 Message-Id: <1365119186-23487-16-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1365119186-23487-1-git-send-email-yinghai@kernel.org> References: <1365119186-23487-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1938 Lines: 59 Move node_possible_map handling out of numa_check_memblks to avoid side changing in numa_check_memblks(). Only set once for successful path instead of resetting in numa_init() every time. Suggested-by: Tejun Heo Signed-off-by: Yinghai Lu --- arch/x86/mm/numa.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index e2ddcbd..1d5fa08 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -539,12 +539,13 @@ static unsigned long __init node_map_pfn_alignment(struct numa_meminfo *mi) static int __init numa_check_memblks(struct numa_meminfo *mi) { + nodemask_t nodes_parsed; unsigned long pfn_align; /* Account for nodes with cpus and no memory */ - node_possible_map = numa_nodes_parsed; - numa_nodemask_from_meminfo(&node_possible_map, mi); - if (WARN_ON(nodes_empty(node_possible_map))) + nodes_parsed = numa_nodes_parsed; + numa_nodemask_from_meminfo(&nodes_parsed, mi); + if (WARN_ON(nodes_empty(nodes_parsed))) return -EINVAL; if (!numa_meminfo_cover_memory(mi)) @@ -596,7 +597,6 @@ static int __init numa_init(int (*init_func)(void)) set_apicid_to_node(i, NUMA_NO_NODE); nodes_clear(numa_nodes_parsed); - nodes_clear(node_possible_map); memset(&numa_meminfo, 0, sizeof(numa_meminfo)); numa_reset_distance(); @@ -672,6 +672,9 @@ void __init x86_numa_init(void) early_x86_numa_init(); + node_possible_map = numa_nodes_parsed; + numa_nodemask_from_meminfo(&node_possible_map, mi); + for (i = 0; i < mi->nr_blks; i++) { struct numa_memblk *mb = &mi->blk[i]; memblock_set_node(mb->start, mb->end - mb->start, mb->nid); -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/