Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752870AbbBYUlL (ORCPT ); Wed, 25 Feb 2015 15:41:11 -0500 Received: from mail-ig0-f180.google.com ([209.85.213.180]:32876 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbbBYUlK (ORCPT ); Wed, 25 Feb 2015 15:41:10 -0500 Date: Wed, 25 Feb 2015 12:41:07 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: Johannes Weiner , Andrew Morton , "\\\"Rafael J. Wysocki\\\"" , Tetsuo Handa , linux-mm@kvack.org, LKML Subject: Re: [PATCH -v2] mm, oom: do not fail __GFP_NOFAIL allocation if oom killer is disbaled In-Reply-To: <20150225140826.GD26680@dhcp22.suse.cz> Message-ID: References: <1424801964-1602-1-git-send-email-mhocko@suse.cz> <20150224191127.GA14718@phnom.home.cmpxchg.org> <20150225140826.GD26680@dhcp22.suse.cz> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1425 Lines: 41 On Wed, 25 Feb 2015, Michal Hocko wrote: > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 2d224bbdf8e8..c2ff40a30003 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2363,7 +2363,8 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, > goto out; > } > /* Exhausted what can be done so it's blamo time */ > - if (out_of_memory(ac->zonelist, gfp_mask, order, ac->nodemask, false)) > + if (out_of_memory(ac->zonelist, gfp_mask, order, ac->nodemask, false) > + || WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL)) > *did_some_progress = 1; > out: > oom_zonelist_unlock(ac->zonelist, gfp_mask); Eek, not sure we actually need to play any games with did_some_progress, it might be clearer just to do this diff --git a/mm/page_alloc.c b/mm/page_alloc.c --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2760,7 +2760,7 @@ retry: &did_some_progress); if (page) goto got_pg; - if (!did_some_progress) + if (!did_some_progress && !(gfp_mask & __GFP_NOFAIL)) goto nopage; } /* Wait for some write requests to complete then retry */ Either way you decide, feel free to add my Acked-by: David Rientjes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/