Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2425879rwd; Fri, 19 May 2023 05:46:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dJkCglhMfqB45FLpo5v3uljrHaMSnmZpV5/ZWkmy6jMZjH8+QOoQHwg432a3oEfs3HVPu X-Received: by 2002:a17:90b:1d03:b0:246:5968:43f0 with SMTP id on3-20020a17090b1d0300b00246596843f0mr2122765pjb.10.1684500411894; Fri, 19 May 2023 05:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684500411; cv=none; d=google.com; s=arc-20160816; b=H6BsMr7x2vwgJZ9gj9opXupntNunrYKb7q2+h5BpwgYJylylikIoJz8gSAs4VQufiR kdTDFJ1GW9xGLuacEYYcNaEvPWfG92AMorPQYQSgYorY8sntWwB5xh7Cta1Kcx3y/TUs ldzYZ6iWqWkFlHfCObjJfSMLG/AXm9a/8RfB+mrzEYtjpFd4RKZ+75XQ0xxuuv80fEIq dPojBBtyCOAtXpDp+e3tF7E1WMPA4kUE4GD9pGKq7hjfqizMdxP9D5/9Q+c4AcfsJDLp Tw9HWxupdNmag5IhAP9Sc0EAH3JRJefTV517OIucYWTpLmRSDGgf/qGsTd28i7QMspDb bMzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I12hzcEozsRt6JPAOpJEFjq1ISq2RgZIT2QaHAH/cww=; b=SXhsviJh9hzhxCiDKPq02K6u8Q6AfHTv1XvcUaJUeyRnRjlNqg1LTKGMgyoix8byJu dkm/HG7sbfjC7S4uThTZvnsZyW5LtOy+BFJ9FBssQpOC9QrgKr9FQZyt30bjlQwhCT2Q 5rTQNjxX65iZXaHX4f5hrZUvZ5c0IWp3YGgFUDbqrbdT8RNd23+vseY+yXBYiobkllcL EQNNd6unv1eUoM5j2YqxzpfQ0azAtXW/+mGrpzSWK5pHAbO9+JlChIt2qVanD/ef30SE gIok2xT2shrVHefdJ3YM6CtkGxRrh12U2i4t6fR1/uJpYbF3++Yd5ezVZPlGFOUmGC6X udog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=GT59zzmh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v22-20020a636116000000b0051a650b8f62si3485630pgb.836.2023.05.19.05.46.35; Fri, 19 May 2023 05:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=GT59zzmh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231550AbjESMk2 (ORCPT + 99 others); Fri, 19 May 2023 08:40:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbjESMkV (ORCPT ); Fri, 19 May 2023 08:40:21 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7091D10D for ; Fri, 19 May 2023 05:40:12 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-96f0678de80so584063166b.3 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=I12hzcEozsRt6JPAOpJEFjq1ISq2RgZIT2QaHAH/cww=; b=GT59zzmhCzWRze5Mlw1ALcSFM9y1f9VU/vsZANEVBYHqrlCkXWWh82A+SSfKkAhcf4 3tQ4UFzmxgxZ15dHaxAEnORekxc5TClUeKGWjmM3kIdHBVyDw4ORdXKtk4UyFNmyLKsx bPrrt63f3L9CI/VluEvxZgTjbObARXFRQrS6O0wUVIlJvsvAh4EhyRGdH/5mzFfSMvAU Ma2idKjNNvoYRHFytUI0nQaXf6rj3SDgQr9NpgZmmj7Yk6zkusJ3ACinYJ0FWUKgb/PF jUETXeREzOwQbPb+s4QGvIlHS2Hg954aU5qGVb5Th2SArEQNshM7l3a3RdF3R0fs+NVo k1Ag== 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=I12hzcEozsRt6JPAOpJEFjq1ISq2RgZIT2QaHAH/cww=; b=S0E8WVigr6I4kZgbh5Q5UKSNyRk/yRSF2DvrSgmOUOJg0NbMUJDt70G+kcomsVCB4V ew3uK1AjBYgsIyYu/MH+Ru+pfFlr6vevuyci/e5VkcaIOmDwSA6qHOkxGo/GJxCuvu0z C+NmZ9oBlbTBA6wjd9lJfv6eqn0OD/MxLU8rcVJIxKF/ndJkcUZRLrm1v9Uj4uga2q0r ol12c058vVCS+B3qVT7QIWrdOs3dUCeb5Hu5ccYRla3B3GnJaOtszGP53QKzCMj8qjkq n7ybNTYSxHQ0h8m7U93aEEbtJ83ufXk1yDpGlKUQjGlxHGr4Mi03fsXWMLu1nsWusmbN k7xQ== X-Gm-Message-State: AC+VfDz5S7WbBZh3rv8vnZwgUf7SLQ8UrshsXCQGocnZpWKpVzChR+WV LGdbfK8ZbTc23RGpYHlWR7yscw== X-Received: by 2002:a17:907:5c7:b0:96a:ed6e:7d58 with SMTP id wg7-20020a17090705c700b0096aed6e7d58mr1561004ejb.7.1684500010821; Fri, 19 May 2023 05:40:10 -0700 (PDT) Received: from localhost ([2a02:8070:6389:7d40:e266:3092:9afb:a7b1]) by smtp.gmail.com with ESMTPSA id q26-20020a170906145a00b00966069b78absm2236221ejc.192.2023.05.19.05.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 05:40:10 -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 4/5] mm: compaction: remove unnecessary is_via_compact_memory() checks Date: Fri, 19 May 2023 14:39:58 +0200 Message-Id: <20230519123959.77335-5-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove from all paths not reachable via /proc/sys/vm/compact_memory. Signed-off-by: Johannes Weiner --- mm/compaction.c | 11 +---------- mm/vmscan.c | 8 +------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 8f61cfa87c49..83ecbc829c62 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2293,9 +2293,6 @@ bool compaction_zonelist_suitable(struct alloc_context *ac, int order, unsigned long available; unsigned long watermark; - if (is_via_compact_memory(order)) - return true; - /* Allocation can already succeed, nothing to do */ watermark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK); if (zone_watermark_ok(zone, order, watermark, @@ -2850,9 +2847,6 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat) if (!populated_zone(zone)) continue; - if (is_via_compact_memory(pgdat->kcompactd_max_order)) - return true; - /* Allocation can already succeed, check other zones */ if (zone_watermark_ok(zone, pgdat->kcompactd_max_order, min_wmark_pages(zone), @@ -2897,9 +2891,6 @@ static void kcompactd_do_work(pg_data_t *pgdat) if (compaction_deferred(zone, cc.order)) continue; - if (is_via_compact_memory(cc.order)) - goto compact; - /* Allocation can already succeed, nothing to do */ if (zone_watermark_ok(zone, cc.order, min_wmark_pages(zone), zoneid, 0)) @@ -2908,7 +2899,7 @@ static void kcompactd_do_work(pg_data_t *pgdat) if (compaction_suitable(zone, cc.order, zoneid) != COMPACT_CONTINUE) continue; -compact: + if (kthread_should_stop()) return; diff --git a/mm/vmscan.c b/mm/vmscan.c index c9c0f3e081f5..c0cfa9b86b48 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -6397,9 +6397,6 @@ static inline bool should_continue_reclaim(struct pglist_data *pgdat, if (!managed_zone(zone)) continue; - if (sc->order == -1) /* is_via_compact_memory() */ - return false; - /* Allocation can already succeed, nothing to do */ if (zone_watermark_ok(zone, sc->order, min_wmark_pages(zone), sc->reclaim_idx, 0)) @@ -6596,9 +6593,6 @@ static inline bool compaction_ready(struct zone *zone, struct scan_control *sc) { unsigned long watermark; - if (sc->order == -1) /* is_via_compact_memory() */ - goto suitable; - /* Allocation can already succeed, nothing to do */ if (zone_watermark_ok(zone, sc->order, min_wmark_pages(zone), sc->reclaim_idx, 0)) @@ -6608,7 +6602,7 @@ static inline bool compaction_ready(struct zone *zone, struct scan_control *sc) if (compaction_suitable(zone, sc->order, sc->reclaim_idx) == COMPACT_SKIPPED) return false; -suitable: + /* * Compaction is already possible, but it takes time to run and there * are potentially other callers using the pages just freed. So proceed -- 2.40.0