Skip to content

mm: fix memcg_data reads during a THP split

Daejun Park b4-sent cgroups linux-mm lkml stable 1 version In review

Get series with b4
b4 am [email protected] change-id 20261028-kpagecgroup-split-8a749c6ee27e

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm/huge_memory: set memcg_data before a split page leaves the foliomm/huge_memory.c mm/memcontrol.c+21 -52 replies
2/2mm/page_owner: also check PageTail before reading memcg_datamm/page_owner.c+7 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchZi Yan
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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/[email protected]/
[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,

Signature · 1 line
Daejun Park <[email protected]>