mm: compaction: limit the suitable target page order to be less than cc->order
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Mon, 22 Jan 2024 13:01:53 +0000 (21:01 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 23:27:16 +0000 (15:27 -0800)
commit1883e8ac96ddd73a87db7f2f8c06111148a3db6f
treed461ba3acda31ac245f55a0cf18e2fb7e40a5eb6
parent45866e0e214f0f1927a09011560c108933435350
mm: compaction: limit the suitable target page order to be less than cc->order

It can not improve the fragmentation if we isolate the target free pages
exceeding cc->order, especially when the cc->order is less than
pageblock_order.  For example, suppose the pageblock_order is MAX_ORDER
(size is 4M) and cc->order is 2M THP size, we should not isolate other 2M
free pages to be the migration target, which can not improve the
fragmentation.

Moreover this is also applicable for large folio compaction.

Link: https://lkml.kernel.org/r/afcd9377351c259df7a25a388a4a0d5862b986f4.1705928395.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c