The patch titled Subject: mmthpcompactioncma-allow-thp-migration-for-cma-allocations-fix has been added to the -mm tree. Its filename is mmthpcompactioncma-allow-thp-migration-for-cma-allocations-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mmthpcompactioncma-allow-thp-migration-for-cma-allocations-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mmthpcompactioncma-allow-thp-migration-for-cma-allocations-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ Author: Rik van Riel <riel@xxxxxxxxxxx> Subject: mmthpcompactioncma-allow-thp-migration-for-cma-allocations-fix 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! Link: http://lkml.kernel.org/r/20200228104700.0af2f18d@xxxxxxxxxxxxxxxxxxxx Signed-off-by: Rik van Riel <riel@xxxxxxxxxxx> Suggested-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Suggested-by: Vlastimil Babka <vbabka@xxxxxxx> Cc: Zi Yan <ziy@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/mm/page_alloc.c~mmthpcompactioncma-allow-thp-migration-for-cma-allocations-fix +++ a/mm/page_alloc.c @@ -8263,12 +8263,12 @@ struct page *has_unmovable_pages(struct 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; _ Patches currently in -mm which might be from riel@xxxxxxxxxxx are mmcompactioncma-add-alloc_contig-flag-to-compact_control.patch mmthpcompactioncma-allow-thp-migration-for-cma-allocations.patch