From mboxrd@z Thu Jan 1 00:00:00 1970 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 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by kanga.kvack.org (Postfix) with ESMTP id B7B0C6B006C for ; Tue, 16 Jun 2015 01:36:00 -0400 (EDT) Received: by pdbnf5 with SMTP id nf5so6330605pdb.2 for ; Mon, 15 Jun 2015 22:36:00 -0700 (PDT) Received: from lgemrelse7q.lge.com (LGEMRELSE7Q.lge.com. [156.147.1.151]) by mx.google.com with ESMTP id w9si13969801pbs.163.2015.06.15.22.35.58 for ; Mon, 15 Jun 2015 22:36:00 -0700 (PDT) Date: Tue, 16 Jun 2015 14:38:07 +0900 From: Joonsoo Kim 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> Sender: owner-linux-mm@kvack.org List-ID: 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 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org