[PATCH 8/9] mm/compaction: call compaction_suit_allocation_order in kcompactd_node_suitable

From: Kemeng Shi
Date: Fri Aug 04 2023 - 23:07:38 EST


Use compaction_suit_allocation_order helper in kcompactd_node_suitable to
remove repeat code.

Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
---
mm/compaction.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 26787ebb0297..f4b6c520038a 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2924,14 +2924,9 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
if (!populated_zone(zone))
continue;

- /* Allocation can already succeed, check other zones */
- if (zone_watermark_ok(zone, pgdat->kcompactd_max_order,
- min_wmark_pages(zone),
- highest_zoneidx, 0))
- continue;
-
- if (compaction_suitable(zone, pgdat->kcompactd_max_order,
- highest_zoneidx))
+ if (compaction_suit_allocation_order(zone,
+ pgdat->kcompactd_max_order,
+ highest_zoneidx, 0) == COMPACT_CONTINUE)
return true;
}

--
2.30.0