From patchwork Fri May 19 12:39:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 13248287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49EAFC7EE23 for ; Fri, 19 May 2023 12:40:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8558D90000A; Fri, 19 May 2023 08:40:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DFA3900003; Fri, 19 May 2023 08:40:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5942290000A; Fri, 19 May 2023 08:40:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 46360900003 for ; Fri, 19 May 2023 08:40:15 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 23E691409DC for ; Fri, 19 May 2023 12:40:15 +0000 (UTC) X-FDA: 80806962390.02.3052624 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf14.hostedemail.com (Postfix) with ESMTP id 19302100006 for ; Fri, 19 May 2023 12:40:12 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=20CNqbvJ; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf14.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.218.46 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684500013; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z4v+oqRzENdCCjglWNqDJ+55Ca3cK8hCc7vsdYbZrmE=; b=IZ6u6rBB0olUWB8ujQ91tSY/9ERvnsBPyerSE7dcrvYDtjT/evAuiGIWpz1Oe2aws4yw01 dafQ7RVaYiTpURo+P6PmwT/FGlpandihYwtxUe9Azie5+vN5l3IsZ0HMi5s91dyveFYz73 XxIjxOLgjsjG/xM6J80HXesz8bszc2A= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=20CNqbvJ; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf14.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.218.46 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684500013; a=rsa-sha256; cv=none; b=PsCIPDnNugYK66YapEWZIHiSc9lOPNKNEUHHds2JQBOexZnfTj2UbuwirnfnADsD8iUXWe 6XsDI5hQwo3RXC3yJplksFydi5pPwkztWJCWI3pv+R2Jr9TKgFkTcbY0nvujij5SWcxC4s N3qogWVkOknJEnfuaWsNk6182TI/MIw= Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-9659e9bbff5so588761566b.1 for ; Fri, 19 May 2023 05:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20221208.gappssmtp.com; s=20221208; t=1684500011; x=1687092011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z4v+oqRzENdCCjglWNqDJ+55Ca3cK8hCc7vsdYbZrmE=; b=20CNqbvJsj1aXxY3uCUm45tf9ezX9S2bW71I97+RgtCqHWhejBmT7D8t6SgGPjZ4D0 78NGrpoPPgmK0cvKKi0ScZpI0FqlVDon7QXVVExvNnUuac/erh7fmnnN3w4DhzvLGwft WCQyIYWLBRXqrhGVyJEHXh8X9AnxXKhTN9drGkBpCz7ERqa241WhCyvJ98dXO21xlppI Sen2Lkn8tmpr3cNnF999AOPTRPS/iKGGc5L/ADLTcg86p/eC2uxUGukPE+/gtpo5wxcu PtBvaa/bveFRu5G2nltWcfYX1Yo0Ff93a5HBQCDMqcQ4Ts5TTOtSy8ylgH/sNIc0mkNn i6Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684500011; x=1687092011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z4v+oqRzENdCCjglWNqDJ+55Ca3cK8hCc7vsdYbZrmE=; b=cnzl5LnpLh5EScK2r2k3F0w+bRYVCc3KoWKsWulgbyYk1m6Aoy2Ls8Aw70kXAoZYym yREMBid5d79vzXFZvHqi2WRziknBR17QyrGWCr/s3dwfxx9bkVeKGjS0V0WN+RfA6QBY 5Qknm6DMKAajlzqkadD3DKk3z7Uuyxn5KGSPaGwaLb8pmmxlTuVnBqt94ll0AQp8X49M +fsrRxEEWR/QBR8wVXQCz6kJ0pA1e8cweZAxZeMJ+Fz82zc4g21pA+wIEoCKyHHkB+W6 iR6Ho7jvOA2Pd2qlnx22A0ixXGoIb1hxKgIl5EUk0FbK1xYUCT/T8vHlwpNd2n02O/4Q BxpQ== X-Gm-Message-State: AC+VfDyDArxty49/DP1STgKM6rysbyvb8At6Ns45MRoO9wUM4xLrD+gy CsiYZ4iin/3/f272kw4Du18Rrb1o+au386+KL/c= X-Google-Smtp-Source: ACHHUZ5HyrBz4voNu4RQsLSn8EHNU2geTDUc+VN5aCe45DZsHq2yRGRL9hB9xWE6eywvCBf1dsLcEQ== X-Received: by 2002:a17:907:26ca:b0:962:582d:89bf with SMTP id bp10-20020a17090726ca00b00962582d89bfmr1351778ejc.55.1684500011653; Fri, 19 May 2023 05:40:11 -0700 (PDT) Received: from localhost ([2a02:8070:6389:7d40:e266:3092:9afb:a7b1]) by smtp.gmail.com with ESMTPSA id a21-20020a170906191500b0096f7ae359a5sm318552eje.30.2023.05.19.05.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 05:40:11 -0700 (PDT) From: Johannes Weiner To: Andrew Morton Cc: Mel Gorman , Vlastimil Babka , Michal Hocko , 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 Message-Id: <20230519123959.77335-6-hannes@cmpxchg.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230519123959.77335-1-hannes@cmpxchg.org> References: <20230519123959.77335-1-hannes@cmpxchg.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 19302100006 X-Stat-Signature: hr9zyy1by3kg1mydeyj3po6qpsckzxwj X-HE-Tag: 1684500012-611048 X-HE-Meta: U2FsdGVkX18HO12Emo17RuGiqB9EeWuu08ikfMviGYr8oZfzmiim9fKgoFDE24yTl1poRkx7k6ILIm9OFgUUDQK/FwOhIZqMg/zwExPt9Q9pK75VfaJpGXJ6SKBcNyMfF5YZi7cZg0sCh5+crjJVT1uNltTdYvVm4VSzG8/XU9w7MDCXfS0STJr4zdBce2JVsCphjs3nYhLM7eMW9UGn1fBH86JbOlOkOLiVm4fyn65stq9iNcDBtJfkruNHOJe6o2K4mJkhb1RuUxh7Bn3YByJceVzsj8AePfovW5tkDY20Qyfon0OV6rdd/Q9g+wTnOS6rmBqf0XBMUY9+YQFmqMQi/3zTAbs05HvwT4cdJB1rLzf38+TVC8VGwwtMTC51u5Aa8kG++dfVT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CJt0Ebg5hA0/82PgLPHjyYA/eqIt8MoaBwcMHmKu+Xw2quJmNFSqk0rFM5GpIprRdCW/QpIjQWof5FWhao6qAA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Acked-by: Vlastimil Babka --- 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