Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757335AbcCCPuV (ORCPT ); Thu, 3 Mar 2016 10:50:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:56045 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754608AbcCCPuU (ORCPT ); Thu, 3 Mar 2016 10:50:20 -0500 Subject: Re: [PATCH 0/3] OOM detection rework v4 To: Joonsoo Kim , Michal Hocko References: <1450203586-10959-1-git-send-email-mhocko@kernel.org> <20160203132718.GI6757@dhcp22.suse.cz> <20160225092315.GD17573@dhcp22.suse.cz> <20160229210213.GX16930@dhcp22.suse.cz> <20160302021954.GA22355@js1304-P5Q-DELUXE> <20160302095056.GB26701@dhcp22.suse.cz> <20160302140611.GI26686@dhcp22.suse.cz> <20160303092634.GB26202@dhcp22.suse.cz> Cc: Joonsoo Kim , Andrew Morton , Hugh Dickins , Linus Torvalds , Johannes Weiner , Mel Gorman , David Rientjes , Tetsuo Handa , Hillf Danton , KAMEZAWA Hiroyuki , Linux Memory Management List , LKML , Sergey Senozhatsky From: Vlastimil Babka Message-ID: <56D85D38.1060404@suse.cz> Date: Thu, 3 Mar 2016 16:50:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1407 Lines: 32 On 03/03/2016 03:10 PM, Joonsoo Kim wrote: > >> [...] >>>>> At least, reset no_progress_loops when did_some_progress. High >>>>> order allocation up to PAGE_ALLOC_COSTLY_ORDER is as important >>>>> as order 0. And, reclaim something would increase probability of >>>>> compaction success. >>>> >>>> This is something I still do not understand. Why would reclaiming >>>> random order-0 pages help compaction? Could you clarify this please? >>> >>> I just can tell simple version. Please check the link from me on another reply. >>> Compaction could scan more range of memory if we have more freepage. >>> This is due to algorithm limitation. Anyway, so, reclaiming random >>> order-0 pages helps compaction. >> >> I will have a look at that code but this just doesn't make any sense. >> The compaction should be reshuffling pages, this shouldn't be a function >> of free memory. > > Please refer the link I mentioned before. There is a reason why more free > memory would help compaction success. Compaction doesn't work > like as random reshuffling. It has an algorithm to reduce system overall > fragmentation so there is limitation. I proposed another way to get better results from direct compaction - don't scan for free pages but get them directly from freelists: https://lkml.org/lkml/2015/12/3/60 But your redesign would be useful too for kcompactd/khugepaged keeping overall fragmentation low.