From: Muchun Song <muchun.song@linux.dev>
To: bingfangguo@tencent.com
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Chinner <david@fromorbit.com>, Qi Zheng <qi.zheng@linux.dev>,
Kairui Song <kasong@tencent.com>, Barry Song <baohua@kernel.org>,
Axel Rasmussen <axelrasmussen@google.com>,
Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>, Bingfang Guo <bfguo@icloud.com>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v2 6/6] mm/memcg: filter out reparented memcgs got from memcgid
Date: Sat, 5 Sep 2026 20:18:03 +0800 [thread overview]
Message-ID: <3F681C23-8462-4BA3-B3C6-B7A45A9341DE@linux.dev> (raw)
In-Reply-To: <20260901-bingfangguo-memcgid-rework-v2-6-8edd7f7a7251@tencent.com>
> On Sep 1, 2026, at 16:58, Bingfang Guo via B4 Relay <devnull+bingfangguo.tencent.com@kernel.org> wrote:
>
> From: Bingfang Guo <bingfangguo@tencent.com>
>
> mem_cgroup_from_private_id() looks up the objcg that owns the id and
> returns the objcg's current memcg. After reparenting, that memcg can
> differ from the one the id originally belonged to.
>
> Callers such as the list lru and workingset refault code expect to get
> back exactly the memcg referred to by the memcgid, so check that the
> returned memcg still owns the id and return NULL otherwise. In this
> case, make list_lru just skip and workingset tests use the root (as the
> comments said in workingset.c:460).
>
> Signed-off-by: Bingfang Guo <bingfangguo@tencent.com>
We should move this patch earlier to avoid introducing the problem first
and then fixing it later.
Muchun,
Thanks.
next prev parent reply other threads:[~2026-09-05 12:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 8:57 [PATCH RFC v2 0/6] mm/memcg: move memcgid refcount to objcg to unpin dying memcgs Bingfang Guo via B4 Relay
2026-09-01 8:58 ` [PATCH RFC v2 1/6] mm/memcg: add a helper to kill the memcgid on offlining Bingfang Guo via B4 Relay
2026-09-01 8:58 ` [PATCH RFC v2 2/6] mm/memcg: get memcgid reference only after swap charging success Bingfang Guo via B4 Relay
2026-09-01 16:15 ` Bingfang Guo
2026-09-05 7:12 ` Muchun Song
2026-09-05 19:35 ` Bingfang Guo
2026-09-01 8:58 ` [PATCH RFC v2 3/6] mm/memcg: pass the id itself instead of memcg for putting ID Bingfang Guo via B4 Relay
2026-09-05 10:01 ` Muchun Song
2026-09-05 19:48 ` Bingfang Guo
2026-09-01 8:58 ` [PATCH RFC v2 4/6] mm/memcg: return the memcg when putting memcgid Bingfang Guo via B4 Relay
2026-09-01 15:58 ` Bingfang Guo
2026-09-05 7:28 ` Muchun Song
2026-09-05 19:36 ` Bingfang Guo
2026-09-01 8:58 ` [PATCH RFC v2 5/6] mm/memcg: move memcg private ID refcount to objcg Bingfang Guo via B4 Relay
2026-09-05 8:46 ` Muchun Song
2026-09-05 19:44 ` Bingfang Guo
2026-09-01 8:58 ` [PATCH RFC v2 6/6] mm/memcg: filter out reparented memcgs got from memcgid Bingfang Guo via B4 Relay
2026-09-02 3:53 ` Bingfang Guo
2026-09-05 12:18 ` Muchun Song [this message]
2026-09-05 19:45 ` Bingfang Guo
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=3F681C23-8462-4BA3-B3C6-B7A45A9341DE@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=bfguo@icloud.com \
--cc=bingfangguo@tencent.com \
--cc=cgroups@vger.kernel.org \
--cc=david@fromorbit.com \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kasong@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@kernel.org \
--cc=qi.zheng@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=weixugc@google.com \
--cc=yuanchu@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