Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754056AbbHYBKO (ORCPT ); Mon, 24 Aug 2015 21:10:14 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:25659 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752296AbbHYBKM (ORCPT ); Mon, 24 Aug 2015 21:10:12 -0400 Message-ID: <55DBC061.8040508@huawei.com> Date: Tue, 25 Aug 2015 09:09:53 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Tang Chen CC: , , , , , , , , , , Subject: Re: [PATCH 1/1] memhp: Add hot-added memory ranges to memblock before allocate node_data for a node. References: <1440349573-24260-1-git-send-email-tangchen@cn.fujitsu.com> <55DAE26E.1050302@huawei.com> In-Reply-To: <55DAE26E.1050302@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.55DBC06F.006F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 385202dcdf31b049a2ff059e66563587 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1716 Lines: 55 On 2015/8/24 17:22, Xishi Qiu wrote: > On 2015/8/24 1:06, Tang Chen wrote: > >> The commit below adds hot-added memory range to memblock, after >> creating pgdat for new node. >> >> commit f9126ab9241f66562debf69c2c9d8fee32ddcc53 >> Author: Xishi Qiu >> Date: Fri Aug 14 15:35:16 2015 -0700 >> >> memory-hotplug: fix wrong edge when hot add a new node >> >> But there is a problem: >> >> add_memory() >> |--> hotadd_new_pgdat() >> |--> free_area_init_node() >> |--> get_pfn_range_for_nid() >> |--> find start_pfn and end_pfn in memblock >> |--> ...... >> |--> memblock_add_node(start, size, nid) -------- Here, just too late. >> >> get_pfn_range_for_nid() will find that start_pfn and end_pfn are both 0. >> As a result, when adding memory, dmesg will give the following wrong message. >> Hi Tang, Another question, if we add cpu first, there will be print error too. cpu_up() try_online_node() hotadd_new_pgdat() So how about just skip the print if the size is empty or just print "node xx is empty now, will update when online memory"? Thanks, Xishi Qiu >> [ 2007.577000] Initmem setup node 5 [mem 0x0000000000000000-0xffffffffffffffff] >> [ 2007.584000] On node 5 totalpages: 0 >> [ 2007.585000] Built 5 zonelists in Node order, mobility grouping on. Total pages: 32588823 >> [ 2007.594000] Policy zone: Normal >> [ 2007.598000] init_memory_mapping: [mem 0x60000000000-0x607ffffffff] >> -- 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/