From: "Jiayuan Chen" <jiayuan.chen@linux.dev>
To: "Shakeel Butt" <shakeel.butt@linux.dev>
Cc: linux-mm@kvack.org, "Tejun Heo" <tj@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Axel Rasmussen" <axelrasmussen@google.com>,
"Yuanchu Xie" <yuanchu@google.com>, "Wei Xu" <weixugc@google.com>,
"David Hildenbrand" <david@kernel.org>,
"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
"Vlastimil Babka" <vbabka@suse.cz>,
"Mike Rapoport" <rppt@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Michal Hocko" <mhocko@suse.com>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Muchun Song" <muchun.song@linux.dev>,
"Qi Zheng" <zhengqi.arch@bytedance.com>,
cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] mm/lru_gen: add memory.lru_gen interface for cgroup v2
Date: Thu, 22 Jan 2026 01:30:42 +0000 [thread overview]
Message-ID: <bac18fc5600a0e8a2f0f5d1e46191ef1e6b64962@linux.dev> (raw)
In-Reply-To: <aXFPhnOn4oGllq_Q@linux.dev>
January 22, 2026 at 06:19, "Shakeel Butt" <shakeel.butt@linux.dev mailto:shakeel.butt@linux.dev?to=%22Shakeel%20Butt%22%20%3Cshakeel.butt%40linux.dev%3E > wrote:
>
> On Wed, Jan 21, 2026 at 08:39:46PM +0800, Jiayuan Chen wrote:
>
> >
> > This patchset adds a memory.lru_gen interface to cgroup v2, allowing users
> > to interact with MGLRU directly on a specific cgroup without needing to
> > know the internal memcg_id.
> >
> Unfortunetely we don't want to expose reclaim implementation specific
> interface to a cgroup.
>
> >
> > Motivation
> > ==========
> > Currently, the only way to perform aging or eviction on a specific memcg
> > is through the debugfs interface (/sys/kernel/debug/lru_gen), which
> > requires the memcg_id. However, there's no straightforward way to get the
> > memcg_id for a given cgroup path. This makes it difficult for users to
> > leverage MGLRU's proactive reclaim capabilities on specific cgroups.
> >
> From the next kernel version, this memcg_id will be inode number of the
> cgroup for this interface. So, a simple 'ls -id cgroup_path' would be
> sufficient for your use-case.
>
> The relevant series [1] is in mm-tree at the moment and if you want, you
> can backport it to your kernels.
>
> [1] https://lkml.kernel.org/r/20251225232116.294540-1-shakeel.butt@linux.dev
>
Hi Shakeel,
Thanks for the review and the pointer to the inode-based memcg_id series.
I agree that using the cgroup inode number as memcg_id will simplify the
write operations (aging/eviction) through the debugfs interface.
However, I'd like to point out that the read operation (viewing lru_gen
info for a specific cgroup) is still not convenient. Currently, users
would need to parse the full debugfs output and grep for the specific
memcg_id, which can be cumbersome especially on systems with many cgroups.
Would it be acceptable to add a read-only command to /lru_gen that only displays
the lru_gen information for the specified cgroup?
Alternatively, if exposing any lru_gen info in cgroup is not desired, I
understand and will use the debugfs approach with scripting.
Thanks,
chenjiayuan
prev parent reply other threads:[~2026-01-22 1:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 12:39 Jiayuan Chen
2026-01-21 12:39 ` [RFC PATCH 1/3] mm/lru_gen: refactor to extract helper functions Jiayuan Chen
2026-01-21 12:39 ` [RFC PATCH 2/3] mm/lru_gen: add memory.lru_gen interface for cgroup v2 Jiayuan Chen
2026-01-21 12:39 ` [RFC PATCH 3/3] docs/cgroup: document memory.lru_gen interface Jiayuan Chen
2026-01-21 22:19 ` [RFC PATCH 0/3] mm/lru_gen: add memory.lru_gen interface for cgroup v2 Shakeel Butt
2026-01-22 1:30 ` Jiayuan Chen [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=bac18fc5600a0e8a2f0f5d1e46191ef1e6b64962@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=vbabka@suse.cz \
--cc=weixugc@google.com \
--cc=yuanchu@google.com \
--cc=zhengqi.arch@bytedance.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