The patch titled Subject: mm, compaction: fast_find_migrateblock() should return pfn in the target zone has been added to the -mm mm-unstable branch. Its filename is mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone.patch This patch will later appear in the mm-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: Rei Yamamoto <yamamoto.rei@xxxxxxxxxxxxxx> Subject: mm, compaction: fast_find_migrateblock() should return pfn in the target zone Prevent returning a pfn outside the target zone in case that not aligned with pageblock boundary. Otherwise isolate_migratepages_block() would handle pages not in the target zone. Link: https://lkml.kernel.org/r/20220511044300.4069-1-yamamoto.rei@xxxxxxxxxxxxxx Signed-off-by: Rei Yamamoto <yamamoto.rei@xxxxxxxxxxxxxx> Reviewed-by: Miaohe Lin <linmiaohe@xxxxxxxxxx> Cc: Don Dutile <ddutile@xxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Wonhyuk Yang <vvghjk1234@xxxxxxxxx> Cc: Rei Yamamoto <yamamoto.rei@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/compaction.c | 2 ++ 1 file changed, 2 insertions(+) --- a/mm/compaction.c~mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone +++ a/mm/compaction.c @@ -1848,6 +1848,8 @@ static unsigned long fast_find_migratebl update_fast_start_pfn(cc, free_pfn); pfn = pageblock_start_pfn(free_pfn); + if (pfn < cc->zone->zone_start_pfn) + pfn = cc->zone->zone_start_pfn; cc->fast_search_fail = 0; found_block = true; set_pageblock_skip(freepage); _ Patches currently in -mm which might be from yamamoto.rei@xxxxxxxxxxxxxx are mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone.patch