Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755901AbbLDQwY (ORCPT ); Fri, 4 Dec 2015 11:52:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:35612 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755803AbbLDQwX (ORCPT ); Fri, 4 Dec 2015 11:52:23 -0500 Subject: Re: [PATCH v3 4/7] mm/compaction: update defer counter when allocation is expected to succeed To: Joonsoo Kim , Andrew Morton References: <1449126681-19647-1-git-send-email-iamjoonsoo.kim@lge.com> <1449126681-19647-5-git-send-email-iamjoonsoo.kim@lge.com> Cc: Mel Gorman , Rik van Riel , David Rientjes , Minchan Kim , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Joonsoo Kim From: Vlastimil Babka Message-ID: <5661C4C5.2020901@suse.cz> Date: Fri, 4 Dec 2015 17:52:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1449126681-19647-5-git-send-email-iamjoonsoo.kim@lge.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2236 Lines: 55 On 12/03/2015 08:11 AM, Joonsoo Kim wrote: > It's rather strange that compact_considered and compact_defer_shift aren't > updated but compact_order_failed is updated when allocation is expected > to succeed. Regardless actual allocation success, deferring for current > order will be disabled so it doesn't result in much difference to > compaction behaviour. The difference is that if the defer reset was wrong, the next compaction attempt that fails would resume the deferred counters? > Moreover, in the past, there is a gap between expectation for allocation > succeess in compaction and actual success in page allocator. But, now, > this gap would be diminished due to providing classzone_idx and alloc_flags > to watermark check in compaction and changed watermark check criteria > for high-order allocation. Therfore, it's not a big problem to update > defer counter when allocation is expected to succeed. This change > will help to simplify defer logic. I guess that's true. But at least some experiment would be better. > Signed-off-by: Joonsoo Kim > --- > include/linux/compaction.h | 2 -- > mm/compaction.c | 27 ++++++++------------------- > mm/page_alloc.c | 1 - > 3 files changed, 8 insertions(+), 22 deletions(-) > ... > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 7002c66..f3605fd 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2815,7 +2815,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, > struct zone *zone = page_zone(page); > > zone->compact_blockskip_flush = false; While we are here, I wonder if this is useful at all? compact_blockskip_flush is set true when scanners meet. That typically means the compaction wasn't successful. Rarely it can be, but I doubt this will make much difference, so we could remove this line as well. > - compaction_defer_reset(zone, order, true); > count_vm_event(COMPACTSUCCESS); > return page; > } > -- 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/