Re: [PATCH v2] mm/migrate_device: Cleanup up PMD Checks and warnings

From: Andrew Morton

Date: Fri Apr 24 2026 - 09:59:29 EST


On Sun, 19 Apr 2026 23:17:43 +0530 Sunny Patel <nueralspacetech@xxxxxxxxx> 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.

AI review might have found a bug in the surrounding code:
https://sashiko.dev/#/patchset/20260419174747.10701-1-nueralspacetech@xxxxxxxxx