linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@techsingularity.net>,
	Vlastimil Babka <vbabka@suse.cz>, Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel-team@fb.com
Subject: [PATCH 5/5] mm: compaction: drop redundant watermark check in compaction_zonelist_suitable()
Date: Fri, 19 May 2023 14:39:59 +0200	[thread overview]
Message-ID: <20230519123959.77335-6-hannes@cmpxchg.org> (raw)
In-Reply-To: <20230519123959.77335-1-hannes@cmpxchg.org>

The watermark check in compaction_zonelist_suitable(), called from
should_compact_retry(), is sandwiched between two watermark checks
already: before, there are freelist attempts as part of direct reclaim
and direct compaction; after, there is a last-minute freelist attempt
in __alloc_pages_may_oom().

The check in compaction_zonelist_suitable() isn't necessary. Kill it.

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

diff --git a/mm/compaction.c b/mm/compaction.c
index 83ecbc829c62..40ce4e6dd17e 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2291,13 +2291,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;
 
 		/*
 		 * Do not consider all the reclaimable memory because we do not
-- 
2.40.0



  parent reply	other threads:[~2023-05-19 12:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19 12:39 [PATCH 0/5] mm: compaction: cleanups & simplifications Johannes Weiner
2023-05-19 12:39 ` [PATCH 1/5] mm: compaction: remove compaction result helpers Johannes Weiner
2023-05-29  9:58   ` Vlastimil Babka
2023-05-19 12:39 ` [PATCH 2/5] mm: compaction: simplify should_compact_retry() Johannes Weiner
2023-05-29 13:03   ` Vlastimil Babka
2023-05-29 16:38     ` Johannes Weiner
2023-05-19 12:39 ` [PATCH 3/5] mm: compaction: refactor __compaction_suitable() Johannes Weiner
2023-05-29 17:11   ` Vlastimil Babka
2023-05-19 12:39 ` [PATCH 4/5] mm: compaction: remove unnecessary is_via_compact_memory() checks Johannes Weiner
2023-05-29 17:12   ` Vlastimil Babka
2023-05-19 12:39 ` Johannes Weiner [this message]
2023-05-29 17:12   ` [PATCH 5/5] mm: compaction: drop redundant watermark check in compaction_zonelist_suitable() Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230519123959.77335-6-hannes@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox