diff mbox series

[RFC,19/26] mm: compaction: drop redundant watermark check in compaction_zonelist_suitable()

Message ID 20230418191313.268131-20-hannes@cmpxchg.org (mailing list archive)
State New
Headers show
Series mm: reliable huge page allocator | expand

Commit Message

Johannes Weiner April 18, 2023, 7:13 p.m. UTC
should_compact_retry() is called after direct reclaim and compaction
have failed to produce a page, to check if there is still enough
compactable memory to warrant continuing. If there aren't, one last
attempt at the freelists happens in __alloc_pages_may_oom(). The
watermark check in should_compact_retry() is not necessary. Kill it.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
 mm/compaction.c | 7 -------
 1 file changed, 7 deletions(-)
diff mbox series

Patch

diff --git a/mm/compaction.c b/mm/compaction.c
index 0aa2a0a192dc..52103545d58c 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2263,13 +2263,6 @@  bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
 	for_each_zone_zonelist_nodemask(zone, z, ac->zonelist,
 				ac->highest_zoneidx, ac->nodemask) {
 		unsigned long available;
-		unsigned long watermark;
-
-		/* Allocation can already succeed, nothing to do */
-		watermark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK);
-		if (zone_watermark_ok(zone, order, watermark,
-				      ac->highest_zoneidx, alloc_flags))
-			continue;
 
 		available = zone_page_state_snapshot(zone, NR_FREE_MOVABLE);
 		available += zone_page_state_snapshot(zone, NR_FREE_CMA_PAGES);