Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161855AbaDPPrh (ORCPT ); Wed, 16 Apr 2014 11:47:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56434 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161580AbaDPPrg (ORCPT ); Wed, 16 Apr 2014 11:47:36 -0400 Message-ID: <534EA601.8040104@redhat.com> Date: Wed, 16 Apr 2014 11:47:13 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Vlastimil Babka , Andrew Morton , Heesub Shin CC: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Dongjun Shin , Sunghwan Yun , Minchan Kim , Mel Gorman , Joonsoo Kim , Bartlomiej Zolnierkiewicz , Michal Nazarewicz , Naoya Horiguchi , Christoph Lameter Subject: Re: [PATCH 1/2] mm/compaction: make isolate_freepages start at pageblock boundary References: <5342BA34.8050006@suse.cz> <1397553507-15330-1-git-send-email-vbabka@suse.cz> In-Reply-To: <1397553507-15330-1-git-send-email-vbabka@suse.cz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/15/2014 05:18 AM, Vlastimil Babka wrote: > The compaction freepage scanner implementation in isolate_freepages() starts > by taking the current cc->free_pfn value as the first pfn. In a for loop, it > scans from this first pfn to the end of the pageblock, and then subtracts > pageblock_nr_pages from the first pfn to obtain the first pfn for the next > for loop iteration. > > This means that when cc->free_pfn starts at offset X rather than being aligned > on pageblock boundary, the scanner will start at offset X in all scanned > pageblock, ignoring potentially many free pages. Currently this can happen when > a) zone's end pfn is not pageblock aligned, or > b) through zone->compact_cached_free_pfn with CONFIG_HOLES_IN_ZONE enabled and > a hole spanning the beginning of a pageblock > > This patch fixes the problem by aligning the initial pfn in isolate_freepages() > to pageblock boundary. This also allows to replace the end-of-pageblock > alignment within the for loop with a simple pageblock_nr_pages increment. > > Signed-off-by: Vlastimil Babka > Reported-by: Heesub Shin > Cc: Minchan Kim > Cc: Mel Gorman > Cc: Joonsoo Kim > Cc: Bartlomiej Zolnierkiewicz > Cc: Michal Nazarewicz > Cc: Naoya Horiguchi > Cc: Christoph Lameter > Cc: Rik van Riel Acked-by: Rik van Riel -- 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/