From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx114.postini.com [74.125.245.114]) by kanga.kvack.org (Postfix) with SMTP id 022246B0033 for ; Fri, 9 Aug 2013 05:42:41 -0400 (EDT) Message-ID: <5204B74B.4050805@cn.fujitsu.com> Date: Fri, 09 Aug 2013 17:32:59 +0800 From: Tang Chen MIME-Version: 1.0 Subject: Re: [PATCH part4 4/4] x86, acpi, numa, mem_hotplug: Find hotpluggable memory in SRAT memory affinities. References: <1375954883-30225-1-git-send-email-tangchen@cn.fujitsu.com> <1375954883-30225-5-git-send-email-tangchen@cn.fujitsu.com> In-Reply-To: Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Sender: owner-linux-mm@kvack.org List-ID: To: Yinghai Lu Cc: Bob Moore , Lv Zheng , "Rafael J. Wysocki" , Len Brown , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Morton , Tejun Heo , Thomas Renninger , Jiang Liu , Wen Congyang , Lai Jiangshan , Yasuaki Ishimatsu , Taku Izumi , Mel Gorman , Minchan Kim , mina86@mina86.com, gong.chen@linux.intel.com, Vasilis Liaskovitis , lwoodman@redhat.com, Rik van Riel , jweiner@redhat.com, Prarit Bhargava , Zhang Yanfei , yanghy@cn.fujitsu.com, the arch/x86 maintainers , "linux-doc@vger.kernel.org" , Linux Kernel Mailing List , Linux MM , ACPI Devel Maling List On 08/09/2013 12:41 AM, Yinghai Lu wrote: > On Thu, Aug 8, 2013 at 2:41 AM, Tang Chen wrote: >> In ACPI SRAT(System Resource Affinity Table), there is a memory affinity for each >> memory range in the system. In each memory affinity, there is a field indicating >> that if the memory range is hotpluggable. >> >> This patch parses all the memory affinities in SRAT only, and find out all the >> hotpluggable memory ranges in the system. > > oh, no. > > How do you make sure the SRAT's entries are right ? > later numa_init could reject srat table if srat ranges does not cover > e820 memmap. In numa_meminfo_cover_memory(), it checks if SRAT covers the e820 ranges. And it uses e820ram = max_pfn - absent_pages_in_range(0, max_pfn) to calculate the e820 ram size. Since max_pfn is initialized before memblock.memory is fulfilled, I think we can also do this check at earlier time. > > Also parse srat table two times looks silly. By parsing SRAT twice, I can avoid memory allocation for acpi_tables_addr in acpi_initrd_override_copy() procedure at such an early time. This memory could also be in hotpluggable area. I think, parsing SRAT memory affinities one more time is clean, no memory allocation, no global variable initialization. All the current numa init pathes will work as before. Thanks. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org