On 2025/8/20 21:49, Zi Yan wrote:
On 20 Aug 2025, at 5:22, Baolin Wang wrote:
On 2025/8/19 02:46, Zi Yan wrote:
The helper gathers a folio order statistics of folios within a virtual address range and checks it against a given order list. It aims to provide a more precise folio order check instead of just checking the existence of PMD folios.
The helper will be used the upcoming commit.
Signed-off-by: Zi Yan ziy@nvidia.com
I tested this patch, and it works for me. Tested-by: Baolin Wang baolin.wang@linux.alibaba.com
Thanks.
By the way, I moved gather_after_split_folio_orders() to the vm_util.c file as a helper for mTHP collapse checks in my patchset[1]. I'm not sure whether you need to move gather_after_split_folio_orders() to vm_util.c in this patch, or if I should move it in my patchset.
Feel free to move it in your patchset. My initial version has it in vm_util.c, but I realized that its implementation is very limited to folio split check and moved it to split_huge_page_test.c. If you find it suitable for your test cases, feel free to move it. Just note that the code does not handle memremapped THP, since it only checks page flags without checking the PFN. So when a vaddr range is mapped to a THP/mTHP head page and some other THP/mTHP tail pages, the code just treats the whole vaddr range as if it is mapped to a single THP/mTHP and gets a wrong order. After-split folios do not have this concern, so gather_after_split_folio_orders() is simplified to not handle such cases.
Thanks for the information. khugepaged also does not have this case, so it works well for me.