Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753789AbbFPFgK (ORCPT ); Tue, 16 Jun 2015 01:36:10 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:40599 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbbFPFf7 (ORCPT ); Tue, 16 Jun 2015 01:35:59 -0400 X-Original-SENDERIP: 10.177.222.220 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Tue, 16 Jun 2015 14:38:07 +0900 From: Joonsoo Kim To: Vlastimil Babka Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Minchan Kim , Mel Gorman , Michal Nazarewicz , Naoya Horiguchi , Christoph Lameter , Rik van Riel , David Rientjes Subject: Re: [PATCH 2/6] mm, compaction: simplify handling restart position in free pages scanner Message-ID: <20150616053807.GB12641@js1304-P5Q-DELUXE> References: <1433928754-966-1-git-send-email-vbabka@suse.cz> <1433928754-966-3-git-send-email-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433928754-966-3-git-send-email-vbabka@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1543 Lines: 29 On Wed, Jun 10, 2015 at 11:32:30AM +0200, Vlastimil Babka wrote: > Handling the position where compaction free scanner should restart (stored in > cc->free_pfn) got more complex with commit e14c720efdd7 ("mm, compaction: > remember position within pageblock in free pages scanner"). Currently the > position is updated in each loop iteration of isolate_freepages(), although it > should be enough to update it only when breaking from the loop. There's also > an extra check outside the loop updates the position in case we have met the > migration scanner. > > This can be simplified if we move the test for having isolated enough from the > for loop header next to the test for contention, and determining the restart > position only in these cases. We can reuse the isolate_start_pfn variable for > this instead of setting cc->free_pfn directly. Outside the loop, we can simply > set cc->free_pfn to current value of isolate_start_pfn without any extra check. > > Also add a VM_BUG_ON to catch possible mistake in the future, in case we later > add a new condition that terminates isolate_freepages_block() prematurely > without also considering the condition in isolate_freepages(). > > Signed-off-by: Vlastimil Babka Acked-by: Joonsoo Kim Thanks. -- 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/