From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) by kanga.kvack.org (Postfix) with ESMTP id DFC496B0009 for ; Fri, 26 Feb 2016 05:27:50 -0500 (EST) Received: by mail-ig0-f179.google.com with SMTP id hb3so31851503igb.0 for ; Fri, 26 Feb 2016 02:27:50 -0800 (PST) Received: from out21.biz.mail.alibaba.com (out114-136.biz.mail.alibaba.com. [205.204.114.136]) by mx.google.com with ESMTP id m1si16047295iom.95.2016.02.26.02.27.49 for ; Fri, 26 Feb 2016 02:27:50 -0800 (PST) Reply-To: "Hillf Danton" From: "Hillf Danton" References: <1450203586-10959-1-git-send-email-mhocko@kernel.org> <20160203132718.GI6757@dhcp22.suse.cz> <20160225092315.GD17573@dhcp22.suse.cz> <009a01d1706a$e666dc00$b3349400$@alibaba-inc.com> <20160226092406.GB8940@dhcp22.suse.cz> In-Reply-To: <20160226092406.GB8940@dhcp22.suse.cz> Subject: Re: [PATCH 0/3] OOM detection rework v4 Date: Fri, 26 Feb 2016 18:27:16 +0800 Message-ID: <00bd01d17080$445ceb00$cd16c100$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Language: zh-cn Sender: owner-linux-mm@kvack.org List-ID: To: 'Michal Hocko' Cc: 'Hugh Dickins' , 'Andrew Morton' , 'Linus Torvalds' , 'Johannes Weiner' , 'Mel Gorman' , 'David Rientjes' , 'Tetsuo Handa' , 'KAMEZAWA Hiroyuki' , linux-mm@kvack.org, 'LKML' , 'Sergey Senozhatsky' >> > > --- a/mm/page_alloc.c Thu Feb 25 15:43:18 2016 > > +++ b/mm/page_alloc.c Fri Feb 26 15:18:55 2016 > > @@ -3113,6 +3113,8 @@ should_reclaim_retry(gfp_t gfp_mask, uns > > struct zone *zone; > > struct zoneref *z; > > > > + if (order <= PAGE_ALLOC_COSTLY_ORDER) > > + return true; > > This is defeating the whole purpose of the rework - to behave > deterministically. You have just disabled the oom killer completely. > This is not the way to go > Then in another direction, below is what I can do. thanks Hillf --- a/mm/page_alloc.c Thu Feb 25 15:43:18 2016 +++ b/mm/page_alloc.c Fri Feb 26 18:14:59 2016 @@ -3366,8 +3366,11 @@ retry: no_progress_loops++; if (should_reclaim_retry(gfp_mask, order, ac, alloc_flags, - did_some_progress > 0, no_progress_loops)) + did_some_progress > 0, no_progress_loops)) { + /* Burn more cycles if any zone seems to satisfy our request */ + no_progress_loops /= 2; goto retry; + } /* Reclaim has failed us, start killing things */ page = __alloc_pages_may_oom(gfp_mask, order, ac, &did_some_progress); -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932536AbcBZK2U (ORCPT ); Fri, 26 Feb 2016 05:28:20 -0500 Received: from mail113-250.mail.alibaba.com ([205.204.113.250]:33931 "EHLO us-alimail-mta1.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932253AbcBZK2R (ORCPT ); Fri, 26 Feb 2016 05:28:17 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01l10450;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_----4YTfE1X_1456482436; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Michal Hocko'" Cc: "'Hugh Dickins'" , "'Andrew Morton'" , "'Linus Torvalds'" , "'Johannes Weiner'" , "'Mel Gorman'" , "'David Rientjes'" , "'Tetsuo Handa'" , "'KAMEZAWA Hiroyuki'" , , "'LKML'" , "'Sergey Senozhatsky'" References: <1450203586-10959-1-git-send-email-mhocko@kernel.org> <20160203132718.GI6757@dhcp22.suse.cz> <20160225092315.GD17573@dhcp22.suse.cz> <009a01d1706a$e666dc00$b3349400$@alibaba-inc.com> <20160226092406.GB8940@dhcp22.suse.cz> In-Reply-To: <20160226092406.GB8940@dhcp22.suse.cz> Subject: Re: [PATCH 0/3] OOM detection rework v4 Date: Fri, 26 Feb 2016 18:27:16 +0800 Message-ID: <00bd01d17080$445ceb00$cd16c100$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQLrn4RotpjS2Y3s/D1LpIleWH8/2gFR+O4RAVq04vYCd5T5zwHUwUkyAnjbuMUBc/n0kZyykAwA Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> > > --- a/mm/page_alloc.c Thu Feb 25 15:43:18 2016 > > +++ b/mm/page_alloc.c Fri Feb 26 15:18:55 2016 > > @@ -3113,6 +3113,8 @@ should_reclaim_retry(gfp_t gfp_mask, uns > > struct zone *zone; > > struct zoneref *z; > > > > + if (order <= PAGE_ALLOC_COSTLY_ORDER) > > + return true; > > This is defeating the whole purpose of the rework - to behave > deterministically. You have just disabled the oom killer completely. > This is not the way to go > Then in another direction, below is what I can do. thanks Hillf --- a/mm/page_alloc.c Thu Feb 25 15:43:18 2016 +++ b/mm/page_alloc.c Fri Feb 26 18:14:59 2016 @@ -3366,8 +3366,11 @@ retry: no_progress_loops++; if (should_reclaim_retry(gfp_mask, order, ac, alloc_flags, - did_some_progress > 0, no_progress_loops)) + did_some_progress > 0, no_progress_loops)) { + /* Burn more cycles if any zone seems to satisfy our request */ + no_progress_loops /= 2; goto retry; + } /* Reclaim has failed us, start killing things */ page = __alloc_pages_may_oom(gfp_mask, order, ac, &did_some_progress); --