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

From: Michal Koutný

Date: Fri Nov 14 2025 - 12:56:28 EST


On Tue, Oct 28, 2025 at 09:58:38PM +0800, Qi Zheng <qi.zheng@xxxxxxxxx> wrote:
> From: Muchun Song <songmuchun@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxx>
> Signed-off-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
> ---
> 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: signature.asc
Description: PGP signature