From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753391AbcEPJ2D (ORCPT ); Mon, 16 May 2016 05:28:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:55945 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752204AbcEPJ2B (ORCPT ); Mon, 16 May 2016 05:28:01 -0400 Subject: Re: [RFC 12/13] mm, compaction: more reliably increase direct compaction priority To: Michal Hocko References: <1462865763-22084-1-git-send-email-vbabka@suse.cz> <1462865763-22084-13-git-send-email-vbabka@suse.cz> <20160513141539.GR20141@dhcp22.suse.cz> <57397760.4060407@suse.cz> <20160516081439.GD23146@dhcp22.suse.cz> Cc: linux-mm@kvack.org, Andrew Morton , Joonsoo Kim , Rik van Riel , David Rientjes , Mel Gorman , Johannes Weiner , Tetsuo Handa , linux-kernel@vger.kernel.org, Linus Torvalds From: Vlastimil Babka Message-ID: <5739929C.5000500@suse.cz> Date: Mon, 16 May 2016 11:27:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160516081439.GD23146@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/16/2016 10:14 AM, Michal Hocko wrote: > On Mon 16-05-16 09:31:44, Vlastimil Babka wrote: >> >> Yeah it should work, my only worry was that this may get subtly wrong (as >> experience shows us) and due to e.g. slightly different watermark checks >> and/or a corner-case zone such as ZONE_DMA, should_reclaim_retry() would >> keep returning true, even if reclaim couldn't/wouldn't help anything. Then >> compaction would be needlessly kept at ineffective priority. > > watermark check for ZONE_DMA should always fail because it fails even > when is completely free to the lowmem reserves. I had a subtle bug in > the original code to check highzone_idx rather than classzone_idx but > that should the fix has been posted recently: > http://lkml.kernel.org/r/1463051677-29418-2-git-send-email-mhocko@kernel.org Sure, but that just adds to the experience of being subtly wrong in this area :) But sure we can leave this part alone until proven wrong, I don't insist strongly. >> Also my understanding of the initial compaction priorities is to lower the >> latency if fragmentation is just light and there's enough memory. Once we >> start struggling, I don't see much point in not switching to the full >> compaction priority quickly. > > That is true but why to compact when there are high order pages and they > are just hidden by the watermark check. Compaction should skip such zone regardless of priority.