On Wed, Mar 27, 2019 at 05:47:06PM +0530, Anshuman Khandual wrote: > > @@ -267,20 +268,26 @@ __reset_isolation_pfn(struct zone *zone, unsigned long pfn, bool check_source, > > get_pageblock_migratetype(page) != MIGRATE_MOVABLE) > > return false; > > > > + /* Ensure the start of the pageblock or zone is online and valid */ > > + block_pfn = pageblock_start_pfn(pfn); > > + block_page = pfn_to_online_page(max(block_pfn, zone->zone_start_pfn)); > > + if (block_page) { > > + page = block_page; > > + pfn = block_pfn; > > + } > > + > > + /* Ensure the end of the pageblock or zone is online and valid */ > > + block_pfn += pageblock_nr_pages; > > + block_pfn = min(block_pfn, zone_end_pfn(zone) - 1); > > + end_page = pfn_to_online_page(block_pfn); > > + if (!end_page) > > + return false; > > Should not we check zone against page_zone() from both start and end page here. The lower address has the max(block_pfn, zone->zone_start_pfn) and the upper address has the min(block_pfn, zone_end_pfn(zone) - 1) check to keep the PFN within the zone boundary. -- Mel Gorman SUSE Labs