Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754669AbdCaGuI (ORCPT ); Fri, 31 Mar 2017 02:50:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:56149 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932446AbdCaGuG (ORCPT ); Fri, 31 Mar 2017 02:50:06 -0400 Date: Fri, 31 Mar 2017 08:50:02 +0200 From: Michal Hocko To: Hillf Danton Cc: linux-mm@kvack.org, "'Andrew Morton'" , "'Mel Gorman'" , "'Vlastimil Babka'" , "'Andrea Arcangeli'" , "'Reza Arbab'" , "'Yasuaki Ishimatsu'" , "'Tang Chen'" , qiuxishi@huawei.com, "'Kani Toshimitsu'" , slaoub@gmail.com, "'Joonsoo Kim'" , "'Andi Kleen'" , "'David Rientjes'" , "'Daniel Kiper'" , "'Igor Mammedov'" , "'Vitaly Kuznetsov'" , "'LKML'" , "'Dan Williams'" , "'Heiko Carstens'" , "'Lai Jiangshan'" , "'Martin Schwidefsky'" Subject: Re: [PATCH 5/6] mm, memory_hotplug: do not associate hotadded memory to zones until online Message-ID: <20170331065002.GD27098@dhcp22.suse.cz> References: <20170330115454.32154-1-mhocko@kernel.org> <20170330115454.32154-6-mhocko@kernel.org> <04c901d2a9e6$91968a20$b4c39e60$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04c901d2a9e6$91968a20$b4c39e60$@alibaba-inc.com> 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 Content-Length: 709 Lines: 26 On Fri 31-03-17 14:18:08, Hillf Danton wrote: > > On March 30, 2017 7:55 PM Michal Hocko wrote: > > > > +static void __meminit resize_zone_range(struct zone *zone, unsigned long start_pfn, > > + unsigned long nr_pages) > > +{ > > + unsigned long old_end_pfn = zone_end_pfn(zone); > > + > > + if (start_pfn < zone->zone_start_pfn) > > + zone->zone_start_pfn = start_pfn; > > + > > + zone->spanned_pages = max(start_pfn + nr_pages, old_end_pfn) - zone->zone_start_pfn; > > +} > The implementation above implies zone can only go bigger. yes, we do not shrink zones currently and I see no poit in doing that right now. > Can we resize zone with the given data? Why couldn't we? -- Michal Hocko SUSE Labs