Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746AbbKXHQp (ORCPT ); Tue, 24 Nov 2015 02:16:45 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:9358 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752295AbbKXHQn (ORCPT ); Tue, 24 Nov 2015 02:16:43 -0500 X-IronPort-AV: E=Sophos;i="5.20,242,1444665600"; d="scan'208";a="778911" Message-ID: <56540E18.3030109@cn.fujitsu.com> Date: Tue, 24 Nov 2015 15:13:28 +0800 From: Tang Chen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Tejun Heo CC: , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 0/5] Make cpuid <-> nodeid mapping persistent. References: <1447906935-31899-1-git-send-email-tangchen@cn.fujitsu.com> <20151123220451.GG19072@mtj.duckdns.org> In-Reply-To: <20151123220451.GG19072@mtj.duckdns.org> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-yoursite-MailScanner-Information: Please contact the ISP for more information X-yoursite-MailScanner-ID: 050874056425.ACC6E X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: tangchen@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1966 Lines: 50 On 11/24/2015 06:04 AM, Tejun Heo wrote: > Hello, > > On Thu, Nov 19, 2015 at 12:22:10PM +0800, Tang Chen wrote: >> [Solution] >> >> There are four mappings in the kernel: >> 1. nodeid (logical node id) <-> pxm >> 2. apicid (physical cpu id) <-> nodeid >> 3. cpuid (logical cpu id) <-> apicid >> 4. cpuid (logical cpu id) <-> nodeid >> >> 1. pxm (proximity domain) is provided by ACPI firmware in SRAT, and nodeid <-> pxm >> mapping is setup at boot time. This mapping is persistent, won't change. >> >> 2. apicid <-> nodeid mapping is setup using info in 1. The mapping is setup at boot >> time and CPU hotadd time, and cleared at CPU hotremove time. This mapping is also >> persistent. >> >> 3. cpuid <-> apicid mapping is setup at boot time and CPU hotadd time. cpuid is >> allocated, lower ids first, and released at CPU hotremove time, reused for other >> hotadded CPUs. So this mapping is not persistent. >> >> 4. cpuid <-> nodeid mapping is also setup at boot time and CPU hotadd time, and >> cleared at CPU hotremove time. As a result of 3, this mapping is not persistent. >> >> To fix this problem, we establish cpuid <-> nodeid mapping for all the possible >> cpus at boot time, and make it persistent. And according to init_cpu_to_node(), >> cpuid <-> nodeid mapping is based on apicid <-> nodeid mapping and cpuid <-> apicid >> mapping. So the key point is obtaining all cpus' apicid. > I don't know much about acpi so can't actually review the patches but > the overall approach looks good to me. Thank you, TJ. Will test it recently. > > Thanks. > -- This message has been scanned for viruses and dangerous content by Fujitsu, and is believed to be clean. -- 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/