Re: [RFC PATCH 09/12] mm/huge_memory: refactor change_huge_pmd() non-present logic
From: Gregory Price
Date: Fri Oct 24 2025 - 14:41:37 EST
On Fri, Oct 24, 2025 at 08:41:25AM +0100, Lorenzo Stoakes wrote:
> Similar to copy_huge_pmd(), there is a large mass of open-coded logic for
> the CONFIG_ARCH_ENABLE_THP_MIGRATION non-present entry case that does not
> use thp_migration_supported() consistently.
>
> Resolve this by separating out this logic and introduce
> change_non_present_huge_pmd().
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> ---
--- >8
> + if (thp_migration_supported() && is_swap_pmd(*pmd)) {
> + change_non_present_huge_pmd(mm, addr, pmd, uffd_wp,
> + uffd_wp_resolve);
You point out the original code doesn't have thp_migration_supported()
is this a bug? or is it benign and just leads to it failing (nicely)
deeper in the stack?
If it's a bug, maybe this patch should be pulled out ahead of the rest?
~Gregory