From: Miaohe Lin Date: Fri, 29 Apr 2022 06:16:18 +0000 (-0700) Subject: mm: compaction: make compaction_zonelist_suitable return false when COMPACT_SUCCESS X-Git-Tag: v6.6.17~7438^2~268 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cff387d6a2949a46d78a4f558938ef7b4cccd41f;p=platform%2Fkernel%2Flinux-rpi.git mm: compaction: make compaction_zonelist_suitable return false when COMPACT_SUCCESS When compact_result indicates that the allocation should now succeed, i.e. compact_result = COMPACT_SUCCESS, compaction_zonelist_suitable should return false because there is no need to do compaction now. Link: https://lkml.kernel.org/r/20220418141253.24298-11-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- diff --git a/mm/compaction.c b/mm/compaction.c index 82c54d7..334a573 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2291,7 +2291,7 @@ bool compaction_zonelist_suitable(struct alloc_context *ac, int order, available += zone_page_state_snapshot(zone, NR_FREE_PAGES); compact_result = __compaction_suitable(zone, order, alloc_flags, ac->highest_zoneidx, available); - if (compact_result != COMPACT_SKIPPED) + if (compact_result == COMPACT_CONTINUE) return true; }