The patch titled Subject: mm/compaction: merge end_pfn boundary check in isolate_freepages_range has been added to the -mm mm-unstable branch. Its filename is mm-compaction-merge-end_pfn-boundary-check-in-isolate_freepages_range.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-compaction-merge-end_pfn-boundary-check-in-isolate_freepages_range.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: Kemeng Shi <shikemeng@xxxxxxxxxx> Subject: mm/compaction: merge end_pfn boundary check in isolate_freepages_range Date: Sun, 30 Jul 2023 01:43:52 +0800 Merge the end_pfn boundary check for single page block forward and multiple page blocks forward to avoid do twice boundary check for multiple page blocks forward. Link: https://lkml.kernel.org/r/20230729174354.2239980-4-shikemeng@xxxxxxxxxxxxxxx Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> Cc: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/compaction.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/mm/compaction.c~mm-compaction-merge-end_pfn-boundary-check-in-isolate_freepages_range +++ a/mm/compaction.c @@ -737,8 +737,6 @@ isolate_freepages_range(struct compact_c /* Protect pfn from changing by isolate_freepages_block */ unsigned long isolate_start_pfn = pfn; - block_end_pfn = min(block_end_pfn, end_pfn); - /* * pfn could pass the block_end_pfn if isolated freepage * is more than pageblock order. In this case, we adjust @@ -747,9 +745,10 @@ isolate_freepages_range(struct compact_c if (pfn >= block_end_pfn) { block_start_pfn = pageblock_start_pfn(pfn); block_end_pfn = pageblock_end_pfn(pfn); - block_end_pfn = min(block_end_pfn, end_pfn); } + block_end_pfn = min(block_end_pfn, end_pfn); + if (!pageblock_pfn_to_page(block_start_pfn, block_end_pfn, cc->zone)) break; _ Patches currently in -mm which might be from shikemeng@xxxxxxxxxx are mm-compaction-correct-comment-of-candidate-pfn-in-fast_isolate_freepages.patch mm-compaction-avoid-unneeded-pageblock_end_pfn-when-no_set_skip_hint-is-set.patch mm-compaction-merge-end_pfn-boundary-check-in-isolate_freepages_range.patch