[PATCH 0/2] mm: fix memcg_data reads during a THP split

From: Daejun Park via B4 Relay

Date: Wed Nov 04 2026 - 05:04:38 EST


Tao Yi reported an oops in page_cgroup_ino() while reading
/proc/kpagecgroup and traced it to the THP split in an RFC [1]. The
RFC skips frozen folios in the reader. Patch 1 moves the memcg_data
copy in the split instead. Patch 2 orders the same loads in
page_owner and needs patch 1.

Charged large kmalloc pages are frozen, so the RFC would report them
as uncharged. My review of the RFC [2] got no reply. Tested on x86_64
with KASAN, see patch 1.

[1] https://lore.kernel.org/all/20260907124001.1544655-1-escape@xxxxxxxxxxxx/
[2] https://lore.kernel.org/all/20261028040418epcms2p7ac0f584cdfdc6a0ea9b7f20eadeada3d@epcms2p7/

---
Daejun Park (2):
mm/huge_memory: set memcg_data before a split page leaves the folio
mm/page_owner: also check PageTail before reading memcg_data

mm/huge_memory.c | 17 +++++++++++++----
mm/memcontrol.c | 9 ++++++++-
mm/page_owner.c | 7 +++++++
3 files changed, 28 insertions(+), 5 deletions(-)
---
base-commit: a13b500946e5dc467976838572b8ddd2fd777ca7
change-id: 20261028-kpagecgroup-split-8a749c6ee27e

Best regards,
--
Daejun Park <daejun7.park@xxxxxxxxxxx>