Re: [PATCH linux-next] mm: huge_memory: remove is_transparent_hugepage()

From: David Hildenbrand
Date: Wed Jun 05 2024 - 04:58:44 EST


On 05.06.24 10:37, xu.xin16@xxxxxxxxxx wrote:
From: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx>

is_transparent_hugepage() was first introduced to ensure the page is
2M THP page. After commit de53c05f2ae3 ("mm: add large_rmappable
page flag") and commit fc4d182316bd ("mm: huge_memory: enable debugfs
to split huge pages to any order"), any large folio of mTHP suitable order
can be split, not only 2M THP page.

Yes.

so the check in split_huge_pages_pid() is not needed here, instead
a folio_test_large() check is sufficient. To ensure a 2M THP folio,
we should use "folio_order(folio) == HPAGE_PMD_ORDER" for now.

What about some kernel-allocated large folio that got mapped using vm_insert_pages() and friends? Are we sure these pages (that are not large_rmappable and not splittable) are properly handled?

--
Cheers,

David / dhildenb