The patch titled Subject: mm: page_isolation: use compound_nr() correctly in isolate_single_pageblock() has been added to the -mm mm-hotfixes-unstable branch. Its filename is mm-page_isolation-use-compound_nr-correctly-in-isolate_single_pageblock.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_isolation-use-compound_nr-correctly-in-isolate_single_pageblock.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 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 via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Zi Yan <ziy@xxxxxxxxxx> Subject: mm: page_isolation: use compound_nr() correctly in isolate_single_pageblock() Date: Mon, 30 May 2022 22:44:50 -0400 When compound_nr(page) was used, page was not guaranteed to be the head of the compound page and it could cause an infinite loop. Fix it by calling it on the head page. Link: https://lkml.kernel.org/r/20220531024450.2498431-1-zi.yan@xxxxxxxx Fixes: b2c9e2fbba32 ("mm: make alloc_contig_range work at pageblock granularity") Signed-off-by: Zi Yan <ziy@xxxxxxxxxx> Reported-by: Anshuman Khandual <anshuman.khandual@xxxxxxx> Link: https://lore.kernel.org/linux-mm/20220530115027.123341-1-anshuman.khandual@xxxxxxx/ Reviewed-by: Anshuman Khandual <anshuman.khandual@xxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Qian Cai <quic_qiancai@xxxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Eric Ren <renzhengeek@xxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxx> Cc: Oscar Salvador <osalvador@xxxxxxx> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_isolation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/page_isolation.c~mm-page_isolation-use-compound_nr-correctly-in-isolate_single_pageblock +++ a/mm/page_isolation.c @@ -385,9 +385,9 @@ static int isolate_single_pageblock(unsi * above do the rest. If migration is not possible, just fail. */ if (PageCompound(page)) { - unsigned long nr_pages = compound_nr(page); struct page *head = compound_head(page); unsigned long head_pfn = page_to_pfn(head); + unsigned long nr_pages = compound_nr(head); if (head_pfn + nr_pages <= boundary_pfn) { pfn = head_pfn + nr_pages; _ Patches currently in -mm which might be from ziy@xxxxxxxxxx are mm-page_isolation-use-compound_nr-correctly-in-isolate_single_pageblock.patch