mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
mm/compaction: merge end_pfn boundary check in isolate_freepages_range
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/[email protected] Signed-off-by: Kemeng Shi <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
committed by
Andrew Morton
parent
1695178900
commit
a2864a6745
+2
-3
@@ -740,8 +740,6 @@ isolate_freepages_range(struct compact_control *cc,
|
||||
/* 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
|
||||
@@ -750,9 +748,10 @@ isolate_freepages_range(struct compact_control *cc,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user