mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Haifeng Xu <haifeng.xu@shopee.com>
Cc: akpm@linux-foundation.org, roman.gushchin@linux.dev,
	songmuchun@bytedance.com, hannes@cmpxchg.org, vbabka@suse.cz,
	willy@infradead.org, vasily.averin@linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memcontrol: Skip root memcg in memcg_memory_event_mm
Date: Thu, 15 Dec 2022 18:18:03 +0000	[thread overview]
Message-ID: <20221215181803.ome46pkh6g7qu3t4@google.com> (raw)
In-Reply-To: <20221215091907.763801-1-haifeng.xu@shopee.com>

On Thu, Dec 15, 2022 at 09:19:07AM +0000, Haifeng Xu wrote:
> The memory events aren't supported on root cgroup, so there is no need
> to account MEMCG_OOM_KILL on root memcg.
> 

Can you explain the scenario where this is happening and causing issue
for you?

> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
> ---
>  include/linux/memcontrol.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 567f12323f55..09f75161a3bc 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -1142,7 +1142,7 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm,
>  
>  	rcu_read_lock();
>  	memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
> -	if (likely(memcg))
> +	if (likely(memcg && !mem_cgroup_is_root(memcg)))

Even if we need this additional check, this is not the right place.

>  		memcg_memory_event(memcg, event);
>  	rcu_read_unlock();
>  }
> -- 
> 2.25.1
> 

  reply	other threads:[~2022-12-15 18:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  9:19 Haifeng Xu
2022-12-15 18:18 ` Shakeel Butt [this message]
2022-12-16  1:43   ` Haifeng Xu
2022-12-16  6:42     ` Shakeel Butt
2022-12-16  7:28       ` Haifeng Xu
2022-12-16  7:36         ` Shakeel Butt
2022-12-16  7:50           ` Haifeng Xu
2022-12-16  8:17             ` Shakeel Butt
2022-12-16  8:37               ` Haifeng Xu

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=20221215181803.ome46pkh6g7qu3t4@google.com \
    --to=shakeelb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=haifeng.xu@shopee.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roman.gushchin@linux.dev \
    --cc=songmuchun@bytedance.com \
    --cc=vasily.averin@linux.dev \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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

all inboxes | Powered by JetHome®