Re: [PATCH v1 25/26] mm: memcontrol: eliminate the problem of dying memory cgroup for LRU folios

Michal Koutný
2025-11-14T17:56:28Z

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]

On Tue, Oct 28, 2025 at 09:58:38PM +0800, Qi Zheng <qi.zheng@linux.dev> wrote:
> From: Muchun Song <songmuchun@bytedance.com>
>
> Pagecache pages are charged at allocation time and hold a reference
> to the original memory cgroup until reclaimed. Depending on memory
> pressure, page sharing patterns between different cgroups and cgroup
> creation/destruction rates, many dying memory cgroups can be pinned
> by pagecache pages, reducing page reclaim efficiency and wasting
> memory. Converting LRU folios and most other raw memory cgroup pins
> to the object cgroup direction can fix this long-living problem.
>
> Finally, folio->memcg_data of LRU folios and kmem folios will always
> point to an object cgroup pointer. The folio->memcg_data of slab
> folios will point to an vector of object cgroups.
>
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
> include/linux/memcontrol.h | 77 +++++----------
> mm/memcontrol-v1.c | 15 +--
> mm/memcontrol.c | 189 +++++++++++++++++++++++--------------
> 3 files changed, 150 insertions(+), 131 deletions(-)

(I know it's not only this patch but all the preceding ones, still)
thanks!

Michal

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]