diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2022-04-28 23:16:19 -0700 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-04-28 23:16:19 -0700 |
commit | ca2864e52d391f8df29da78261592502ffadd9d9 (patch) | |
tree | 1ca3b7635d384fe64fd211c9d79ca6d4b4c70731 /mm/compaction.c | |
parent | fa599c44987df43eb5cd5d60e9868fc2c790d9dc (diff) |
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.com
Signed-off-by: Miaohe 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: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 609a76d7e051..65970107b789 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1532,7 +1532,7 @@ fast_isolate_freepages(struct compact_control *cc) * not found, be pessimistic for direct compaction * and use the min mark. */ - if (highest) { + if (highest >= min_pfn) { page = pfn_to_page(highest); cc->free_pfn = highest; } else { |