Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752287AbdCaGSq (ORCPT ); Fri, 31 Mar 2017 02:18:46 -0400 Received: from out0-194.mail.aliyun.com ([140.205.0.194]:38389 "EHLO out0-194.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbdCaGSp (ORCPT ); Fri, 31 Mar 2017 02:18:45 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03297;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=24;SR=0;TI=SMTPD_---.7t25yvk_1490941088; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Michal Hocko'" , Cc: "'Andrew Morton'" , "'Mel Gorman'" , "'Vlastimil Babka'" , "'Andrea Arcangeli'" , "'Reza Arbab'" , "'Yasuaki Ishimatsu'" , "'Tang Chen'" , , "'Kani Toshimitsu'" , , "'Joonsoo Kim'" , "'Andi Kleen'" , "'David Rientjes'" , "'Daniel Kiper'" , "'Igor Mammedov'" , "'Vitaly Kuznetsov'" , "'LKML'" , "'Michal Hocko'" , "'Dan Williams'" , "'Heiko Carstens'" , "'Lai Jiangshan'" , "'Martin Schwidefsky'" References: <20170330115454.32154-1-mhocko@kernel.org> <20170330115454.32154-6-mhocko@kernel.org> In-Reply-To: <20170330115454.32154-6-mhocko@kernel.org> Subject: Re: [PATCH 5/6] mm, memory_hotplug: do not associate hotadded memory to zones until online Date: Fri, 31 Mar 2017 14:18:08 +0800 Message-ID: <04c901d2a9e6$91968a20$b4c39e60$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFU6y+5EAZL2+8hDBYbLS7ZosefXwGoqSqXopyu4+A= Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 598 Lines: 19 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. Can we resize zone with the given data? btw, this mail address, Zhang Zhen , is not reachable. Hillf