The split_huge_pmd_locked function currently performs redundant checks
for migration entries and folio validation that are already handled by
the page_vma_mapped_walk mechanism in try_to_migrate_one.
Specifically, page_vma_mapped_walk already ensures that:
- The folio is properly mapped in the given VMA area
- pmd_trans_huge, pmd_devmap, and migration entry validation are
performed
To leverage page_vma_mapped_walk's work, moving TTU_SPLIT_HUGE_PMD
handling to the while loop checking and removing these duplicate checks
from split_huge_pmd_locked.
Suggested-by: David Hildenbrand <david@xxxxxxxxxx>
Link: https://lore.kernel.org/all/98d1d195-7821-4627-b518-83103ade56c0@xxxxxxxxxx/
Link: https://lore.kernel.org/all/91599a3c-e69e-4d79-bac5-5013c96203d7@xxxxxxxxxx/
Signed-off-by: Gavin Guo <gavinguo@xxxxxxxxxx>
Acked-by: David Hildenbrand <david@xxxxxxxxxx>