From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933001AbcKWHAG (ORCPT ); Wed, 23 Nov 2016 02:00:06 -0500 Received: from mail-wj0-f171.google.com ([209.85.210.171]:33979 "EHLO mail-wj0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932469AbcKWHAF (ORCPT ); Wed, 23 Nov 2016 02:00:05 -0500 Date: Wed, 23 Nov 2016 08:00:02 +0100 From: Michal Hocko To: Hillf Danton Cc: "'Linus Torvalds'" , "'Vlastimil Babka'" , "'Marc MERLIN'" , "'linux-mm'" , "'LKML'" , "'Joonsoo Kim'" , "'Tejun Heo'" , "'Greg Kroah-Hartman'" Subject: Re: 4.8.8 kernel trigger OOM killer repeatedly when I have lots of RAM that should be free Message-ID: <20161123070002.GC2864@dhcp22.suse.cz> References: <20161121154336.GD19750@merlins.org> <0d4939f3-869d-6fb8-0914-5f74172f8519@suse.cz> <20161121215639.GF13371@merlins.org> <20161122160629.uzt2u6m75ash4ved@merlins.org> <48061a22-0203-de54-5a44-89773bff1e63@suse.cz> <20161123063410.GB2864@dhcp22.suse.cz> <01a101d24556$4262a230$c727e690$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01a101d24556$4262a230$c727e690$@alibaba-inc.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 23-11-16 14:53:12, Hillf Danton wrote: > On Wednesday, November 23, 2016 2:34 PM Michal Hocko wrote: > > @@ -3161,6 +3161,16 @@ should_compact_retry(struct alloc_context *ac, unsigned int order, int alloc_fla > > if (!order || order > PAGE_ALLOC_COSTLY_ORDER) > > return false; > > > > +#ifdef CONFIG_COMPACTION > > + /* > > + * This is a gross workaround to compensate a lack of reliable compaction > > + * operation. We cannot simply go OOM with the current state of the compaction > > + * code because this can lead to pre mature OOM declaration. > > + */ > > + if (order <= PAGE_ALLOC_COSTLY_ORDER) > > No need to check order once more. yes simple return true would be sufficient but I wanted the code to be more obvious. > Plus can we retry without CONFIG_COMPACTION enabled? Yes checking the order-0 watermark was the original implementation of the high order retry without compaction enabled. I do not rememeber any reports for that so I didn't want to touch that path. -- Michal Hocko SUSE Labs