LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	"\\\"Rafael J. Wysocki\\\"" <rjw@rjwysocki.net>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -v2] mm, oom: do not fail __GFP_NOFAIL allocation if oom killer is disbaled
Date: Thu, 26 Feb 2015 18:34:45 +0100	[thread overview]
Message-ID: <20150226173445.GG14878@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.10.1502251240150.18097@chino.kir.corp.google.com>

On Wed 25-02-15 12:41:07, David Rientjes wrote:
> 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

We would loose the warning which _might_ be helpful and I also find this
place better because it is close to the out_of_memory and this one has
only one failure mode. So I would prefer to stick with this unless there
are big objections.

> 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 <rientjes@gooogle.com>

Thanks!

Andrew, should I repost or you can pick it up from this thread? Assuming
you and others do not have objections of course.

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2015-02-26 17:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 18:19 [PATCH] " Michal Hocko
2015-02-24 18:22 ` Michal Hocko
2015-02-24 19:11 ` Johannes Weiner
2015-02-24 20:23   ` David Rientjes
2015-02-25 14:08     ` [PATCH -v2] " Michal Hocko
2015-02-25 20:41       ` David Rientjes
2015-02-26 17:34         ` Michal Hocko [this message]
2015-02-24 22:09   ` [PATCH] " Konstantin Khlebnikov
2015-02-24 22:16     ` Konstantin Khlebnikov
2015-02-25 14:02   ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150226173445.GG14878@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rientjes@google.com \
    --cc=rjw@rjwysocki.net \
    --subject='Re: [PATCH -v2] mm, oom: do not fail __GFP_NOFAIL allocation if oom killer is disbaled' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).