From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753485AbcEROk6 (ORCPT ); Wed, 18 May 2016 10:40:58 -0400 Received: from outbound-smtp11.blacknight.com ([46.22.139.16]:47912 "EHLO outbound-smtp11.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753386AbcEROk4 (ORCPT ); Wed, 18 May 2016 10:40:56 -0400 Date: Wed, 18 May 2016 15:40:52 +0100 From: Mel Gorman To: Michal Hocko Cc: Vlastimil Babka , linux-mm@kvack.org, Andrew Morton , Joonsoo Kim , Rik van Riel , David Rientjes , Johannes Weiner , Tetsuo Handa , linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [RFC 13/13] mm, compaction: fix and improve watermark handling Message-ID: <20160518144052.GH2527@techsingularity.net> References: <1462865763-22084-1-git-send-email-vbabka@suse.cz> <1462865763-22084-14-git-send-email-vbabka@suse.cz> <20160516092505.GE23146@dhcp22.suse.cz> <20160518135004.GE2527@techsingularity.net> <20160518142753.GJ21654@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20160518142753.GJ21654@dhcp22.suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 18, 2016 at 04:27:53PM +0200, Michal Hocko wrote: > > > > - __compaction_suitable() then checks the low watermark plus a (2 << order) gap > > > > to decide if there's enough free memory to perform compaction. This check > > > > > > And this was a real head scratcher when I started looking into the > > > compaction recently. Why do we need to be above low watermark to even > > > start compaction. Compaction uses additional memory only for a short > > > period of time and then releases the already migrated pages. > > > > > > > Simply minimising the risk that compaction would deplete the entire > > zone. Sure, it hands pages back shortly afterwards. At the time of the > > initial prototype, page migration was severely broken and the system was > > constantly crashing. The cautious checks were left in place after page > > migration was fixed as there wasn't a compelling reason to remove them > > at the time. > > OK, then moving to min_wmark + bias from low_wmark should work, right? Yes. I did recall there was another reason but it's marginal. I didn't want compaction isolation free pages to artifically push a process into direct reclaim but given that we are likely under memory pressure at that time anyway, it's unlikely that compaction is the sole reason processes are entering direct reclaim. -- Mel Gorman SUSE Labs