summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2023-06-02 17:12:04 +0200
committerAndrew Morton <akpm@linux-foundation.org>2023-06-10 01:25:37 +0200
commit3cf04937529020e149666f56a41ebdeb226b69ed (patch)
treeae0f3d6f489ee70581ffecb27cd1c5abf5581da8 /mm/vmscan.c
parentmm: compaction: drop redundant watermark check in compaction_zonelist_suitable() (diff)
downloadlinux-3cf04937529020e149666f56a41ebdeb226b69ed.tar.xz
linux-3cf04937529020e149666f56a41ebdeb226b69ed.zip
mm: compaction: have compaction_suitable() return bool
Since it only returns COMPACT_CONTINUE or COMPACT_SKIPPED now, a bool return value simplifies the callsites. Link: https://lkml.kernel.org/r/20230602151204.GD161817@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Suggested-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 99e4ae44850d..df7e52b522ec 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -6404,8 +6404,7 @@ static inline bool should_continue_reclaim(struct pglist_data *pgdat,
sc->reclaim_idx, 0))
return false;
- if (compaction_suitable(zone, sc->order,
- sc->reclaim_idx) == COMPACT_CONTINUE)
+ if (compaction_suitable(zone, sc->order, sc->reclaim_idx))
return false;
}
@@ -6601,8 +6600,7 @@ static inline bool compaction_ready(struct zone *zone, struct scan_control *sc)
return true;
/* Compaction cannot yet proceed. Do reclaim. */
- if (compaction_suitable(zone, sc->order,
- sc->reclaim_idx) == COMPACT_SKIPPED)
+ if (!compaction_suitable(zone, sc->order, sc->reclaim_idx))
return false;
/*