@@ -8274,12 +8274,12 @@ struct page *has_unmovable_pages(struct zone *zone, struct page *page,
struct page *head = compound_head(page);
unsigned int skip_pages;
- if (PageHuge(page) &&
- !hugepage_migration_supported(page_hstate(head)))
- return page;
-
- if (!PageLRU(head) && !__PageMovable(head))
+ if (PageHuge(page)) {
+ if (!hugepage_migration_supported(page_hstate(head)))
+ return page;
+ } else if (!PageLRU(head) && !__PageMovable(head)) {
return page;
+ }
skip_pages = compound_nr(head) - (page - head);
iter += skip_pages - 1;
Thank you Mike & Vlastimil! ---8<--- commit 27f3cd5473d8bbf591b61d8b93b98bc333980d0d Author: Rik van Riel <riel@surriel.com> Date: Fri Feb 28 10:41:48 2020 -0500 Subject: fix mmthpcompactioncma-allow-thp-migration-for-cma-allocations.patch Mike Kravetz pointed out that the second if condition could do the wrong thing for hugetlbfs pages, and that check really only needs to run on THPs. Cleanup suggested by Vlastimil. Thank you both! Suggested-by: Mike Kravetz <mike.kravetz@oracle.com> Suggested-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Rik van Riel <riel@surriel.com>