Re: [PATCH v2] mm/migrate_device: Cleanup up PMD Checks and warnings
From: Zi Yan
Date: Sun Apr 19 2026 - 13:50:40 EST
On 19 Apr 2026, at 13:47, Sunny Patel wrote:
> Remove the odd VM_WARN_ON_FOLIO(!folio, folio) usage and replace it
> with a simpler VM_WARN_ON_ONCE(!folio) check.
>
> Drop the redundant VM_WARN_ON_ONCE(!pmd_none(*pmdp) &&
> !is_huge_zero_pmd(*pmdp)).
>
> Refactor the PMD checks, making the control flow
> clearer and avoiding duplicate condition checks.
>
> Signed-off-by: Sunny Patel <nueralspacetech@xxxxxxxxx>
> ---
>
> Changes in v2:
> - Removed additional check for pmd_present() as is_huge_zero_pmd()
> already checks for pmd_present().
>
> Missed it in first version of this patch.
>
> mm/migrate_device.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
LGTM.
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
--
Best Regards,
Yan, Zi