Commit ca2864e5 authored by Miaohe Lin's avatar Miaohe Lin Committed by akpm

mm: compaction: make sure highest is above the min_pfn

It's not guaranteed that highest will be above the min_pfn.  If highest is
below the min_pfn, migrate_pfn and free_pfn can meet prematurely and lead
to some useless work.  Make sure highest is above min_pfn to avoid making
a futile effort.

Link: https://lkml.kernel.org/r/20220418141253.24298-13-linmiaohe@huawei.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Cc: Charan Teja Kalla <charante@codeaurora.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Pintu Kumar <pintu@codeaurora.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent fa599c44
...@@ -1532,7 +1532,7 @@ fast_isolate_freepages(struct compact_control *cc) ...@@ -1532,7 +1532,7 @@ fast_isolate_freepages(struct compact_control *cc)
* not found, be pessimistic for direct compaction * not found, be pessimistic for direct compaction
* and use the min mark. * and use the min mark.
*/ */
if (highest) { if (highest >= min_pfn) {
page = pfn_to_page(highest); page = pfn_to_page(highest);
cc->free_pfn = highest; cc->free_pfn = highest;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment