From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751446AbdEBNFe (ORCPT ); Tue, 2 May 2017 09:05:34 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35513 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbdEBNFa (ORCPT ); Tue, 2 May 2017 09:05:30 -0400 From: Wei Yang To: kirill@shutemov.name, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, tj@kernel.org, rientjes@google.com Cc: linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH V2 3/3] x86/numa_emulation: restructures numa_nodes_parsed from emulated nodes Date: Tue, 2 May 2017 21:04:53 +0800 Message-Id: <20170502130453.5933-4-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170502130453.5933-1-richard.weiyang@gmail.com> References: <20170502130453.5933-1-richard.weiyang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By emulating numa, it may contains more or less nodes than physical nodes. In numa_emulation(), numa_meminfo/numa_distance/__apicid_to_node is restructured according to emulated nodes, except numa_nodes_parsed. This patch restructures numa_nodes_parsed from emulated nodes. Signed-off-by: Wei Yang Acked-by: David Rientjes --- v2: use nodes_clear(numa_nodes_parsedd); --- arch/x86/mm/numa_emulation.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c index a6d01931b9a1..6e5ccbfc3deb 100644 --- a/arch/x86/mm/numa_emulation.c +++ b/arch/x86/mm/numa_emulation.c @@ -391,6 +391,13 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) /* commit */ *numa_meminfo = ei; + /* Make sure numa_nodes_parsed only contains emulated nodes */ + nodes_clear(numa_nodes_parsed); + for (i = 0; i < ARRAY_SIZE(ei.blk); i++) + if (ei.blk[i].start != ei.blk[i].end && + ei.blk[i].nid != NUMA_NO_NODE) + node_set(ei.blk[i].nid, numa_nodes_parsed); + /* * Transform __apicid_to_node table to use emulated nids by * reverse-mapping phys_nid. The maps should always exist but fall -- 2.11.0