Checking hstate at early phase when isolating page, instead of during unmap and move phase, to avoid useless isolation. Signed-off-by: Li Xinhai <lixinhai.lxh@xxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> --- include/linux/mempolicy.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 5228c62..986e51d 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h @@ -185,10 +185,9 @@ static inline bool vma_migratable(struct vm_area_struct *vma) if (vma_is_dax(vma)) return false; -#ifndef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION - if (vma->vm_flags & VM_HUGETLB) + if (is_vm_hugetlb_page(vma) && + !hugepage_migration_supported(hstate_vma(vma))) return false; -#endif /* * Migration allocates pages in the highest zone. If we cannot -- 1.8.3.1