linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Shakeel Butt <shakeelb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <guro@fb.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memcg, oom: no oom-kill for __GFP_RETRY_MAYFAIL
Date: Mon, 29 Apr 2019 08:22:14 -0400	[thread overview]
Message-ID: <20190429122214.GK21837@dhcp22.suse.cz> (raw)
In-Reply-To: <20190428235613.166330-1-shakeelb@google.com>

On Sun 28-04-19 16:56:13, Shakeel Butt wrote:
> The documentation of __GFP_RETRY_MAYFAIL clearly mentioned that the
> OOM killer will not be triggered and indeed the page alloc does not
> invoke OOM killer for such allocations. However we do trigger memcg
> OOM killer for __GFP_RETRY_MAYFAIL. Fix that.

An example of __GFP_RETRY_MAYFAIL memcg OOM report would be nice. I
thought we haven't been using that flag for memcg allocations yet.
But this is definitely good to have addressed.

> Signed-off-by: Shakeel Butt <shakeelb@google.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/memcontrol.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 2713b45ec3f0..99eca724ed3b 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2294,7 +2294,6 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
>  	unsigned long nr_reclaimed;
>  	bool may_swap = true;
>  	bool drained = false;
> -	bool oomed = false;
>  	enum oom_status oom_status;
>  
>  	if (mem_cgroup_is_root(memcg))
> @@ -2381,7 +2380,7 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
>  	if (nr_retries--)
>  		goto retry;
>  
> -	if (gfp_mask & __GFP_RETRY_MAYFAIL && oomed)
> +	if (gfp_mask & __GFP_RETRY_MAYFAIL)
>  		goto nomem;
>  
>  	if (gfp_mask & __GFP_NOFAIL)
> @@ -2400,7 +2399,6 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
>  	switch (oom_status) {
>  	case OOM_SUCCESS:
>  		nr_retries = MEM_CGROUP_RECLAIM_RETRIES;
> -		oomed = true;
>  		goto retry;
>  	case OOM_FAILED:
>  		goto force;
> -- 
> 2.21.0.593.g511ec345e18-goog
> 

-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2019-04-29 12:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28 23:56 Shakeel Butt
2019-04-29 12:22 ` Michal Hocko [this message]
2019-04-29 14:37   ` Shakeel Butt
2019-04-29 14:52     ` 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=20190429122214.GK21837@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shakeelb@google.com \
    --cc=vdavydov.dev@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox