From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933959AbdDETjx (ORCPT ); Wed, 5 Apr 2017 15:39:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:33821 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933802AbdDETjj (ORCPT ); Wed, 5 Apr 2017 15:39:39 -0400 Date: Wed, 5 Apr 2017 21:39:34 +0200 From: Michal Hocko To: Reza Arbab 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 Message-ID: <20170405193933.GW6035@dhcp22.suse.cz> References: <20170404164452.GQ15132@dhcp22.suse.cz> <20170404183012.a6biape5y7vu6cjm@arbab-laptop> <20170404194122.GS15132@dhcp22.suse.cz> <20170404214339.6o4c4uhwudyhzbbo@arbab-laptop> <20170405064239.GB6035@dhcp22.suse.cz> <20170405092427.GG6035@dhcp22.suse.cz> <20170405145304.wxzfavqxnyqtrlru@arbab-laptop> <20170405154258.GR6035@dhcp22.suse.cz> <20170405173248.4vtdgk2kolbzztya@arbab-laptop> <20170405181502.GU6035@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170405181502.GU6035@dhcp22.suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 05-04-17 20:15:02, Michal Hocko wrote: > On Wed 05-04-17 12:32:49, Reza Arbab wrote: > > On Wed, Apr 05, 2017 at 05:42:59PM +0200, Michal Hocko wrote: > > >But one thing that is really bugging me is how could you see low pfns in > > >the previous oops. Please drop the last patch and sprinkle printks down > > >the remove_memory path to see where this all go south. I believe that > > >there is something in the initialization code lurking in my code. Please > > >also scratch the pfn_valid check in online_pages diff. It will not help > > >here. > > > > Got it. > > > > shrink_pgdat_span: start_pfn=0x10000, end_pfn=0x10100, pgdat_start_pfn=0x0, pgdat_end_pfn=0x20000 > > > > The problem is that pgdat_start_pfn here should be 0x10000. As you > > suspected, it never got set. This fixes things for me. > > > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > > index 623507f..37c1b63 100644 > > --- a/mm/memory_hotplug.c > > +++ b/mm/memory_hotplug.c > > @@ -884,7 +884,7 @@ static void __meminit resize_pgdat_range(struct pglist_data *pgdat, unsigned lon > > { > > unsigned long old_end_pfn = pgdat_end_pfn(pgdat); > > > > - if (start_pfn < pgdat->node_start_pfn) > > + if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn) > > pgdat->node_start_pfn = start_pfn; > > Dang! You are absolutely right. This explains the issue during the > remove_memory. I still fail to see how this makes any difference for the > sysfs file registration though. If anything the pgdat will be larger and > so try_offline_node would check also unrelated node0 but the code will > handle that and eventually offline the node1 anyway. /me still confused. OK, so I've managed to convince my kvm setup to create a node without any memory initially but I cannot seem to be able to reach node_set_offline in try_offline_node because check_and_unmap_cpu_on_node fails for me even when I offline cpus bound to the node because we are using for_each_present_cpu in check_cpu_on_node so I would have to start with a cpuless node or find a way how to hotremove those cpus. -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by kanga.kvack.org (Postfix) with ESMTP id ADB866B03A8 for ; Wed, 5 Apr 2017 15:39:39 -0400 (EDT) Received: by mail-wr0-f199.google.com with SMTP id w11so3136779wrc.2 for ; Wed, 05 Apr 2017 12:39:39 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id 51si2189290wrc.11.2017.04.05.12.39.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 05 Apr 2017 12:39:38 -0700 (PDT) Date: Wed, 5 Apr 2017 21:39:34 +0200 From: Michal Hocko Subject: Re: [PATCH 0/6] mm: make movable onlining suck less Message-ID: <20170405193933.GW6035@dhcp22.suse.cz> References: <20170404164452.GQ15132@dhcp22.suse.cz> <20170404183012.a6biape5y7vu6cjm@arbab-laptop> <20170404194122.GS15132@dhcp22.suse.cz> <20170404214339.6o4c4uhwudyhzbbo@arbab-laptop> <20170405064239.GB6035@dhcp22.suse.cz> <20170405092427.GG6035@dhcp22.suse.cz> <20170405145304.wxzfavqxnyqtrlru@arbab-laptop> <20170405154258.GR6035@dhcp22.suse.cz> <20170405173248.4vtdgk2kolbzztya@arbab-laptop> <20170405181502.GU6035@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170405181502.GU6035@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Reza Arbab 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 On Wed 05-04-17 20:15:02, Michal Hocko wrote: > On Wed 05-04-17 12:32:49, Reza Arbab wrote: > > On Wed, Apr 05, 2017 at 05:42:59PM +0200, Michal Hocko wrote: > > >But one thing that is really bugging me is how could you see low pfns in > > >the previous oops. Please drop the last patch and sprinkle printks down > > >the remove_memory path to see where this all go south. I believe that > > >there is something in the initialization code lurking in my code. Please > > >also scratch the pfn_valid check in online_pages diff. It will not help > > >here. > > > > Got it. > > > > shrink_pgdat_span: start_pfn=0x10000, end_pfn=0x10100, pgdat_start_pfn=0x0, pgdat_end_pfn=0x20000 > > > > The problem is that pgdat_start_pfn here should be 0x10000. As you > > suspected, it never got set. This fixes things for me. > > > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > > index 623507f..37c1b63 100644 > > --- a/mm/memory_hotplug.c > > +++ b/mm/memory_hotplug.c > > @@ -884,7 +884,7 @@ static void __meminit resize_pgdat_range(struct pglist_data *pgdat, unsigned lon > > { > > unsigned long old_end_pfn = pgdat_end_pfn(pgdat); > > > > - if (start_pfn < pgdat->node_start_pfn) > > + if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn) > > pgdat->node_start_pfn = start_pfn; > > Dang! You are absolutely right. This explains the issue during the > remove_memory. I still fail to see how this makes any difference for the > sysfs file registration though. If anything the pgdat will be larger and > so try_offline_node would check also unrelated node0 but the code will > handle that and eventually offline the node1 anyway. /me still confused. OK, so I've managed to convince my kvm setup to create a node without any memory initially but I cannot seem to be able to reach node_set_offline in try_offline_node because check_and_unmap_cpu_on_node fails for me even when I offline cpus bound to the node because we are using for_each_present_cpu in check_cpu_on_node so I would have to start with a cpuless node or find a way how to hotremove those cpus. -- Michal Hocko SUSE Labs -- 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