mbox series

[0/2] kpageflags: fix wrong KPF_THP on non-pmd-mappable compound pages

Message ID 20240626024924.1155558-1-ranxiaokai627@163.com (mailing list archive)
Headers show
Series kpageflags: fix wrong KPF_THP on non-pmd-mappable compound pages | expand

Message

Ran Xiaokai June 26, 2024, 2:49 a.m. UTC
From: Ran Xiaokai <ran.xiaokai@zte.com.cn>

KPF_THP means that the folio is a 2M pmd mappable compound page,
meanwhile KPF_COMPOUND_HEAD and KPF_COMPOUND_TAIL are used to
indicate common compound pages, so after commit 19eaf44954df
("mm: thp: support allocation of anonymous multi-size THP"),
the folio_test_large() in stable_page_flags() is insufficient
and should be replaced with folio_test_pmd_mappable().

Patch1 is a preparation to solve the compile time warning introduced
by patch2.

Patch2 replaces folio_test_large() with folio_test_pmd_mappable() to
indicate KPF_THP for only pmd mappable THP.

Ran Xiaokai (2):
  mm: Constify folio_order()/folio_test_pmd_mappable()
  kpageflags: fix wrong KPF_THP on non-pmd-mappable compound pages

 fs/proc/page.c          | 14 ++++----------
 include/linux/huge_mm.h |  2 +-
 include/linux/mm.h      |  2 +-
 3 files changed, 6 insertions(+), 12 deletions(-)