Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933991AbbLVWFK (ORCPT ); Tue, 22 Dec 2015 17:05:10 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36811 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932740AbbLVWFI (ORCPT ); Tue, 22 Dec 2015 17:05:08 -0500 Date: Tue, 22 Dec 2015 14:05:06 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Joonsoo Kim cc: Andrew Morton , Vlastimil Babka , Aaron Lu , Mel Gorman , Rik van Riel , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Joonsoo Kim Subject: Re: [PATCH 1/2] mm/compaction: fix invalid free_pfn and compact_cached_free_pfn In-Reply-To: <1450678432-16593-1-git-send-email-iamjoonsoo.kim@lge.com> Message-ID: References: <1450678432-16593-1-git-send-email-iamjoonsoo.kim@lge.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1521 Lines: 29 On Mon, 21 Dec 2015, Joonsoo Kim wrote: > free_pfn and compact_cached_free_pfn are the pointer that remember > restart position of freepage scanner. When they are reset or invalid, > we set them to zone_end_pfn because freepage scanner works in reverse > direction. But, because zone range is defined as [zone_start_pfn, > zone_end_pfn), zone_end_pfn is invalid to access. Therefore, we should > not store it to free_pfn and compact_cached_free_pfn. Instead, we need > to store zone_end_pfn - 1 to them. There is one more thing we should > consider. Freepage scanner scan reversely by pageblock unit. If free_pfn > and compact_cached_free_pfn are set to middle of pageblock, it regards > that sitiation as that it already scans front part of pageblock so we > lose opportunity to scan there. To fix-up, this patch do round_down() > to guarantee that reset position will be pageblock aligned. > > Note that thanks to the current pageblock_pfn_to_page() implementation, > actual access to zone_end_pfn doesn't happen until now. But, following > patch will change pageblock_pfn_to_page() so this patch is needed > from now on. > > Acked-by: Vlastimil Babka > Signed-off-by: Joonsoo Kim Acked-by: David Rientjes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/