Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751340AbdCPBv4 (ORCPT ); Wed, 15 Mar 2017 21:51:56 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:58970 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbdCPBvy (ORCPT ); Wed, 15 Mar 2017 21:51:54 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 165.244.249.23 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Thu, 16 Mar 2017 10:53:23 +0900 From: Joonsoo Kim To: Vlastimil Babka CC: Andrew Morton , , , Johannes Weiner , Mel Gorman , David Rientjes , , Subject: Re: [PATCH v3 4/8] mm, page_alloc: count movable pages when stealing from pageblock Message-ID: <20170316015323.GB14063@js1304-P5Q-DELUXE> References: <20170307131545.28577-1-vbabka@suse.cz> <20170307131545.28577-5-vbabka@suse.cz> MIME-Version: 1.0 In-Reply-To: <20170307131545.28577-5-vbabka@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/16 10:51:50, Serialize by Router on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/16 10:51:50, Serialize complete at 2017/03/16 10:51:50 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1166 Lines: 24 On Tue, Mar 07, 2017 at 02:15:41PM +0100, Vlastimil Babka wrote: > When stealing pages from pageblock of a different migratetype, we count how > many free pages were stolen, and change the pageblock's migratetype if more > than half of the pageblock was free. This might be too conservative, as there > might be other pages that are not free, but were allocated with the same > migratetype as our allocation requested. I think that too conservative is good for movable case. In my experiments, fragmentation spreads out when unmovable/reclaimable pageblock is changed to movable pageblock prematurely ('prematurely' means that allocated unmovable pages remains). As you said below, movable allocations falling back to other pageblocks don't causes permanent fragmentation. Therefore, we don't need to be less conservative for movable allocation. So, how about following change to keep the criteria for movable allocation conservative even with this counting improvement? threshold = (1 << (pageblock_order - 1)); if (start_type == MIGRATE_MOVABLE) threshold += (1 << (pageblock_order - 2)); if (free_pages + alike_pages >= threshold) ... Thanks.