On 6/11/26 2:06 PM, Lance Yang wrote:
On Wed, Jun 10, 2026 at 06:29:12PM +0800, Baolin Wang wrote: [...]@@ -2768,15 +2827,23 @@ static enum scan_result collapse_scan_file(struct mm_struct *mm, else cc->progress += HPAGE_PMD_NR; - if (result == SCAN_SUCCEED) { - if (present < HPAGE_PMD_NR - max_ptes_none) { - result = SCAN_EXCEED_NONE_PTE; - count_vm_event(THP_SCAN_EXCEED_NONE_PTE); - } else { - result = collapse_file(mm, addr, file, start, cc, HPAGE_PMD_ORDER); - } + if (result != SCAN_SUCCEED) + goto out; + + if (present < HPAGE_PMD_NR - max_ptes_none) { + result = SCAN_EXCEED_NONE_PTE; + count_vm_event(THP_SCAN_EXCEED_NONE_PTE); + count_mthp_stat(HPAGE_PMD_ORDER, + MTHP_STAT_COLLAPSE_EXCEED_NONE); + goto out; } + result = mthp_collapse(mm, file, start, addr, 0, 0, cc, enabled_orders);Feels like the second 0 wants to be "swap", no?
It seems so. This reminds me of the issue you’re trying to fix in [1]. [1] https://lore.kernel.org/all/[email protected]/

