mm/compaction: factor out code to test if we should run compaction for target order
authorKemeng Shi <shikemeng@huaweicloud.com>
Fri, 1 Sep 2023 15:51:41 +0000 (23:51 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Oct 2023 17:32:19 +0000 (10:32 -0700)
commite19a3f595ae47bd8c034b98eb0b28a3877413387
treea973de22551afab89a6d70fa3e844d4c1ecb5402
parent9cc17ede5125933ab47f8f359c2cce3aca8ee757
mm/compaction: factor out code to test if we should run compaction for target order

We always do zone_watermark_ok check and compaction_suitable check
together to test if compaction for target order should be ran.  Factor
these code out to remove repeat code.

Link: https://lkml.kernel.org/r/20230901155141.249860-7-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c