Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934043AbdDEUzu (ORCPT ); Wed, 5 Apr 2017 16:55:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57439 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755676AbdDEUzl (ORCPT ); Wed, 5 Apr 2017 16:55:41 -0400 Date: Wed, 5 Apr 2017 15:55:29 -0500 From: Reza Arbab To: Michal Hocko Cc: Mel Gorman , linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Andrea Arcangeli , Yasuaki Ishimatsu , Tang Chen , qiuxishi@huawei.com, Kani Toshimitsu , slaoub@gmail.com, Joonsoo Kim , Andi Kleen , Zhang Zhen , David Rientjes , Daniel Kiper , Igor Mammedov , Vitaly Kuznetsov , LKML , Chris Metcalf , Dan Williams , Heiko Carstens , Lai Jiangshan , Martin Schwidefsky Subject: Re: [PATCH 0/6] mm: make movable onlining suck less References: <20170404073412.GC15132@dhcp22.suse.cz> <20170404082302.GE15132@dhcp22.suse.cz> <20170404160239.ftvuxklioo6zvuxl@arbab-laptop> <20170404164452.GQ15132@dhcp22.suse.cz> <20170404183012.a6biape5y7vu6cjm@arbab-laptop> <20170404194122.GS15132@dhcp22.suse.cz> <20170404214339.6o4c4uhwudyhzbbo@arbab-laptop> <20170405064239.GB6035@dhcp22.suse.cz> <20170405154852.kdkwuudjv2jwvj5g@arbab-laptop> <20170405163439.GS6035@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170405163439.GS6035@dhcp22.suse.cz> Organization: IBM Linux Technology Center User-Agent: NeoMutt/20170306 (1.8.0) X-TM-AS-GCONF: 00 x-cbid: 17040520-0036-0000-0000-000001D15721 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006887; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00843593; UDB=6.00415668; IPR=6.00621771; BA=6.00005271; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014925; XFM=3.00000013; UTC=2017-04-05 20:55:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040520-0037-0000-0000-00003F79445D Message-Id: <20170405205529.2bs4yhrfffmkwi5g@arbab-laptop> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-05_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704050173 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1285 Lines: 47 On Wed, Apr 05, 2017 at 06:34:39PM +0200, Michal Hocko wrote: >This is really interesting. Because add_memory_resource does the >following > /* call arch's memory hotadd */ > ret = arch_add_memory(nid, start, size); > > if (ret < 0) > goto error; > > /* we online node here. we can't roll back from here. */ > node_set_online(nid); > >so we are setting the node online _after_ arch_add_memory but the code >which adds those sysfs file is called from > >arch_add_memory > __add_pages > __add_section > register_new_memory > register_mem_sect_under_node > node_online check Okay, so it turns out the original code ends up creating the sysfs links not here, but just a little bit afterwards. add_memory add_memory_resource arch_add_memory [your quoted stack trace above] ... set_node_online ... register_one_node link_mem_sections register_mem_sect_under_node The reason they're not getting created now is because NODE_DATA(nid)->node_spanned_pages = 0 at this point. link_mem_sections: nid=1, start_pfn=0x10000, end_pfn=0x10000 This is another uninitialized situation, like the one with node_start_pfn which caused my removal crash. Except here I'm not sure the correct place to splice in and set it. -- Reza Arbab