reparent the THP split queue
From: | Qi Zheng <zhengqi.arch-AT-bytedance.com> | |
To: | hannes-AT-cmpxchg.org, hughd-AT-google.com, mhocko-AT-suse.com, roman.gushchin-AT-linux.dev, shakeel.butt-AT-linux.dev, muchun.song-AT-linux.dev, david-AT-redhat.com, lorenzo.stoakes-AT-oracle.com, ziy-AT-nvidia.com, baolin.wang-AT-linux.alibaba.com, Liam.Howlett-AT-oracle.com, npache-AT-redhat.com, ryan.roberts-AT-arm.com, dev.jain-AT-arm.com, baohua-AT-kernel.org, lance.yang-AT-linux.dev, akpm-AT-linux-foundation.org | |
Subject: | [PATCH 0/4] reparent the THP split queue | |
Date: | Fri, 19 Sep 2025 11:46:31 +0800 | |
Message-ID: | <cover.1758253018.git.zhengqi.arch@bytedance.com> | |
Cc: | linux-mm-AT-kvack.org, linux-kernel-AT-vger.kernel.org, cgroups-AT-vger.kernel.org, Qi Zheng <zhengqi.arch-AT-bytedance.com> | |
Archive-link: | Article |
Hi all, In the future, we will reparent LRU folios during memcg offline to eliminate dying memory cgroups, which requires reparenting the THP split queue to its parent memcg. Similar to list_lru, the split queue is relatively independent and does not need to be reparented along with objcg and LRU folios (holding objcg lock and lru lock). Therefore, we can apply the same mechanism as list_lru to reparent the split queue first when memcg is offine. The first three patches in this series are separated from the series "Eliminate Dying Memory Cgroup" [1], mainly to do some cleanup and preparatory work. The changes to them are as follows: - fix bad unlock balance in [PATCH RFC 06/28] - fix the missing cleanup of partially_mapped state and counter in [PATCH RFC 07/28] - collect Acked-bys The last patch reparents the THP split queue to its parent memcg during memcg offline. This series is based on the next-20250917. Comments and suggestions are welcome! Thanks, Qi [1]. https://lore.kernel.org/all/20250415024532.26632-1-songmu... Muchun Song (3): mm: thp: replace folio_memcg() with folio_memcg_charged() mm: thp: introduce folio_split_queue_lock and its variants mm: thp: use folio_batch to handle THP splitting in deferred_split_scan() Qi Zheng (1): mm: thp: reparent the split queue during memcg offline include/linux/huge_mm.h | 1 + include/linux/memcontrol.h | 10 ++ include/linux/mmzone.h | 1 + mm/huge_memory.c | 218 ++++++++++++++++++++++++------------- mm/memcontrol.c | 1 + mm/mm_init.c | 1 + 6 files changed, 157 insertions(+), 75 deletions(-) -- 2.20.1