linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Haifeng Xu <haifeng.xu@shopee.com>
Cc: shakeelb@google.com, hannes@cmpxchg.org,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm, oom: do not check 0 mask in out_of_memory()
Date: Mon, 8 May 2023 16:22:21 +0200	[thread overview]
Message-ID: <ZFkFnY052onmeFnp@dhcp22.suse.cz> (raw)
In-Reply-To: <20230508073538.1168-1-haifeng.xu@shopee.com>

On Mon 08-05-23 07:35:38, Haifeng Xu wrote:
> Since commit 60e2793d440a ("mm, oom: do not trigger out_of_memory
> from the #PF"), no user sets gfp_mask to 0. Remove the 0 mask check
> and update the comments.
> 
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>

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

> ---
>  mm/oom_kill.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index 044e1eed720e..612b5597d3af 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -1130,12 +1130,10 @@ bool out_of_memory(struct oom_control *oc)
>  
>  	/*
>  	 * The OOM killer does not compensate for IO-less reclaim.
> -	 * pagefault_out_of_memory lost its gfp context so we have to
> -	 * make sure exclude 0 mask - all other users should have at least
> -	 * ___GFP_DIRECT_RECLAIM to get here. But mem_cgroup_oom() has to
> -	 * invoke the OOM killer even if it is a GFP_NOFS allocation.
> +	 * But mem_cgroup_oom() has to invoke the OOM killer even
> +	 * if it is a GFP_NOFS allocation.
>  	 */
> -	if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc))
> +	if (!(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc))
>  		return true;
>  
>  	/*
> -- 
> 2.25.1

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2023-05-08 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08  7:35 Haifeng Xu
2023-05-08 14:22 ` Michal Hocko [this message]

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=ZFkFnY052onmeFnp@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=haifeng.xu@shopee.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shakeelb@google.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