diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 4d252f0a34965314d8f58cf6d2ca6aba4a939449..fd0e06d3a87d2506146b078760176bc81916186a 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -879,6 +879,11 @@ static inline void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, #else /* CONFIG_HUGETLB_PAGE */ struct hstate {}; +static inline struct hugepage_subpool *hugetlb_page_subpool(struct page *hpage) +{ + return NULL; +} + static inline struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve) diff --git a/mm/migrate.c b/mm/migrate.c index f05bcfab26d5dd069eda1c83650c5ba7395999cc..d76ad37dda875703d3434ebb9c55ff245a805fd0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1319,7 +1319,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, * page_mapping() set, hugetlbfs specific move page routine will not * be called and we could leak usage counts for subpools. */ - if (page_private(hpage) && !page_mapping(hpage)) { + if (hugetlb_page_subpool(hpage) && !page_mapping(hpage)) { rc = -EBUSY; goto out_unlock; }