Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754165AbbLGIC7 (ORCPT ); Mon, 7 Dec 2015 03:02:59 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:48475 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752764AbbLGIC6 (ORCPT ); Mon, 7 Dec 2015 03:02:58 -0500 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Mon, 7 Dec 2015 17:04:07 +0900 From: Joonsoo Kim To: Vlastimil Babka Cc: Andrew Morton , Mel Gorman , Rik van Riel , David Rientjes , Minchan Kim , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 5/7] mm/compaction: respect compaction order when updating defer counter Message-ID: <20151207080407.GD27292@js1304-P5Q-DELUXE> References: <1449126681-19647-1-git-send-email-iamjoonsoo.kim@lge.com> <1449126681-19647-6-git-send-email-iamjoonsoo.kim@lge.com> <5661CA16.9010304@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5661CA16.9010304@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: 3101 Lines: 89 On Fri, Dec 04, 2015 at 06:15:02PM +0100, Vlastimil Babka wrote: > On 12/03/2015 08:11 AM, Joonsoo Kim wrote: > >It doesn't make sense that we reset defer counter > >in compaction_defer_reset() when compaction request under the order of > >compact_order_failed succeed. Fix it. > > Right. > > >And, it does make sense that giving enough chance for updated failed > >order compaction before deferring. Change it. > > Sorry, can't understand the meaning here. From the code it seems > that you want to reset defer_shift to 0 instead of increasing it, > when the current order is lower than the failed one? That makes > sense, yeah. You correctly understand my intention. :) > How about this? > > "On the other hand, when deferring compaction for an order lower > than the current compact_order_failed, we can assume the lower order > will recover more quickly, so we should reset the progress made > previously on compact_defer_shift with the higher order." Will add it. > > >Signed-off-by: Joonsoo Kim > > Acked-by: Vlastimil Babka Thanks. > > >--- > > mm/compaction.c | 19 +++++++++++-------- > > 1 file changed, 11 insertions(+), 8 deletions(-) > > > >diff --git a/mm/compaction.c b/mm/compaction.c > >index 67b8d90..1a75a6e 100644 > >--- a/mm/compaction.c > >+++ b/mm/compaction.c > >@@ -126,11 +126,14 @@ static struct page *pageblock_pfn_to_page(unsigned long start_pfn, > > */ > > static void defer_compaction(struct zone *zone, int order) > > { > >- zone->compact_considered = 0; > >- zone->compact_defer_shift++; > >- > >- if (order < zone->compact_order_failed) > >+ if (order < zone->compact_order_failed) { > >+ zone->compact_considered = 0; > >+ zone->compact_defer_shift = 0; > > zone->compact_order_failed = order; > >+ } else { > >+ zone->compact_considered = 0; > >+ zone->compact_defer_shift++; > >+ } > > > > if (zone->compact_defer_shift > COMPACT_MAX_DEFER_SHIFT) > > zone->compact_defer_shift = COMPACT_MAX_DEFER_SHIFT; > >@@ -161,11 +164,11 @@ bool compaction_deferred(struct zone *zone, int order) > > /* Update defer tracking counters after successful compaction of given order */ > > static void compaction_defer_reset(struct zone *zone, int order) > > { > >- zone->compact_considered = 0; > >- zone->compact_defer_shift = 0; > >- > >- if (order >= zone->compact_order_failed) > >+ if (order >= zone->compact_order_failed) { > >+ zone->compact_considered = 0; > >+ zone->compact_defer_shift = 0; > > zone->compact_order_failed = order + 1; > >+ } > > > > trace_mm_compaction_defer_reset(zone, order); > > } > > > > -- > 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 -- 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/