linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roman Gushchin <roman.gushchin@linux.dev>
To: Haifeng Xu <haifeng.xu@shopee.com>
Cc: mhocko@kernel.org, hannes@cmpxchg.org, shakeelb@google.com,
	cgroups@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] memcg, oom: unmark under_oom after the oom killer is done
Date: Fri, 22 Sep 2023 16:17:28 -0700	[thread overview]
Message-ID: <ZQ4giCbTqUpmKWAa@P9FQF9L96D.corp.robot.car> (raw)
In-Reply-To: <20230922070529.362202-1-haifeng.xu@shopee.com>

On Fri, Sep 22, 2023 at 07:05:28AM +0000, Haifeng Xu wrote:
> When application in userland receives oom notification from kernel
> and reads the oom_control file, it's confusing that under_oom is 0
> though the omm killer hasn't finished. The reason is that under_oom
> is cleared before invoking mem_cgroup_out_of_memory(), so move the
> action that unmark under_oom after completing oom handling. Therefore,
> the value of under_oom won't mislead users.
> 
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>

Makes sense to me.

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks!

> ---
>  mm/memcontrol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index e8ca4bdcb03c..0b6ed63504ca 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1970,8 +1970,8 @@ static bool mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order)
>  	if (locked)
>  		mem_cgroup_oom_notify(memcg);
>  
> -	mem_cgroup_unmark_under_oom(memcg);
>  	ret = mem_cgroup_out_of_memory(memcg, mask, order);
> +	mem_cgroup_unmark_under_oom(memcg);
>  
>  	if (locked)
>  		mem_cgroup_oom_unlock(memcg);
> -- 
> 2.25.1
> 


  reply	other threads:[~2023-09-22 23:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22  7:05 Haifeng Xu
2023-09-22 23:17 ` Roman Gushchin [this message]
2023-09-23  8:05   ` Haifeng Xu
2023-09-25  7:57 ` Michal Hocko
2023-09-25  9:03   ` Haifeng Xu
2023-09-25 11:38     ` Michal Hocko
2023-09-25 12:28       ` Haifeng Xu
2023-09-25 12:37         ` Michal Hocko
2023-09-26 14:39           ` Haifeng Xu
2023-09-27 13:36             ` Michal Hocko
2023-09-28  3:03               ` Haifeng Xu
2023-10-03  7:50                 ` Michal Hocko
2023-10-11  1:59                   ` Haifeng Xu
2023-10-25 21:48                     ` Andrew Morton

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=ZQ4giCbTqUpmKWAa@P9FQF9L96D.corp.robot.car \
    --to=roman.gushchin@linux.dev \
    --cc=cgroups@vger.kernel.org \
    --cc=haifeng.xu@shopee.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.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