From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932177AbcEKTXj (ORCPT ); Wed, 11 May 2016 15:23:39 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:51631 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932131AbcEKTXi (ORCPT ); Wed, 11 May 2016 15:23:38 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: arbab@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 11 May 2016 14:23:26 -0500 From: Reza Arbab To: Yasuaki Ishimatsu Cc: Greg Kroah-Hartman , Andrew Morton , Daniel Kiper , Dan Williams , Vlastimil Babka , Tang Chen , Joonsoo Kim , David Vrabel , Vitaly Kuznetsov , David Rientjes , Andrew Banman , Chen Yucong , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yasuaki Ishimatsu Subject: Re: [PATCH 2/3] memory-hotplug: more general validation of zone during online Message-ID: <20160511192326.GE22115@arbab-laptop.austin.ibm.com> References: <1462816419-4479-1-git-send-email-arbab@linux.vnet.ibm.com> <1462816419-4479-3-git-send-email-arbab@linux.vnet.ibm.com> <573223b8.c52b8d0a.9a3c0.6217@mx.google.com> <20160510203943.GA22115@arbab-laptop.austin.ibm.com> <57334d15.524a370a.4b1f7.fffff006@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <57334d15.524a370a.4b1f7.fffff006@mx.google.com> Organization: IBM Linux Technology Center User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16051119-0021-0000-0000-00004E7134FD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 11, 2016 at 08:17:41AM -0700, Yasuaki Ishimatsu wrote: >On Tue, 10 May 2016 15:39:43 -0500 >Reza Arbab wrote: > >> + if (idx < target) { >> + /* pages must be at end of current zone */ >> + if (pfn + nr_pages != zone_end_pfn(zone)) >> + return 0; > >> + if (target < idx) { >> + /* pages must be at beginning of current zone */ >> + if (pfn != zone->zone_start_pfn) >> + return 0; > >According your patch, memory address must be continuous for changing zone. >So if memory address is uncontinuous as follows, memory address 0x180000000-0x1FFFFFFFF >can be changed from ZONE_NORMAL to ZONE_MOVABLE. But memory address 0x80000000-0xFFFFFFFF >can not be changed from ZONE_NORMAL to ZONE_MOVABLE since it does not meet >above condition. > >Memory address > 0x80000000 - 0xFFFFFFFF > 0x180000000 - 0x1FFFFFFFF Ah, I see. What do you think of this instead? + if (idx < target) { + /* must be the last pages present in current zone */ + for (i = pfn + nr_pages; i < zone_end_pfn(zone); i++) + if (pfn_present(i)) + return 0; + if (target < idx) { + /* must be the first pages present in current zone */ + for (i = zone->zone_start_pfn; i < pfn; i++) + if (pfn_present(i)) + return 0; -- Reza Arbab