lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bac18fc5600a0e8a2f0f5d1e46191ef1e6b64962@linux.dev>
Date: Thu, 22 Jan 2026 01:30:42 +0000
From: "Jiayuan Chen" <jiayuan.chen@...ux.dev>
To: "Shakeel Butt" <shakeel.butt@...ux.dev>
Cc: linux-mm@...ck.org, "Tejun Heo" <tj@...nel.org>, "Johannes Weiner"
 <hannes@...xchg.org>, "Michal Koutný"
 <mkoutny@...e.com>, "Jonathan Corbet" <corbet@....net>, "Andrew Morton"
 <akpm@...ux-foundation.org>, "Axel Rasmussen" <axelrasmussen@...gle.com>,
 "Yuanchu Xie" <yuanchu@...gle.com>, "Wei Xu" <weixugc@...gle.com>, "David
 Hildenbrand" <david@...nel.org>, "Lorenzo Stoakes"
 <lorenzo.stoakes@...cle.com>, "Liam R. Howlett"
 <Liam.Howlett@...cle.com>, "Vlastimil Babka" <vbabka@...e.cz>, "Mike
 Rapoport" <rppt@...nel.org>, "Suren Baghdasaryan" <surenb@...gle.com>,
 "Michal Hocko" <mhocko@...e.com>, "Roman Gushchin"
 <roman.gushchin@...ux.dev>, "Muchun Song" <muchun.song@...ux.dev>, "Qi
 Zheng" <zhengqi.arch@...edance.com>, cgroups@...r.kernel.org,
 linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 0/3] mm/lru_gen: add memory.lru_gen interface for
 cgroup v2

January 22, 2026 at 06:19, "Shakeel Butt" <shakeel.butt@...ux.dev mailto:shakeel.butt@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ