Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6404772rwb; Tue, 22 Nov 2022 12:56:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf6sm6/853AhwpRbDS0cFsCEIZWl0L3UXEuLhbMgddAZXtvKNse0Xs8c+a1TZJVX+j+wbasu X-Received: by 2002:a17:90b:4382:b0:20b:c375:575 with SMTP id in2-20020a17090b438200b0020bc3750575mr26665088pjb.174.1669150571822; Tue, 22 Nov 2022 12:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669150571; cv=none; d=google.com; s=arc-20160816; b=fJrF2bOWqcdCGtsLSFxRwgdBjD9y8Zs5UQR7SgSX2lnT/i+rsVBpi4J3Rmx0EsSZ+d P7KNK3t0btysCd8rMjXvbmcvfTY1BGLj2GLLr3nzQ4nhI8sMB9oGRCIjgJ4LqlKgahLt JcPytpy2i3kfTlOfZH7hMAIyrcUHoLtCezBd3k4aVPZU/ozYWcJFtsJe99xLvLcRKbTy C18R4Z3TZtU64XqtFx9S0dXHj5WqtFK+mVA5hjMMtTVFeZbqYlv1jBjPq4tiXuwyQfCx ON9FkRU/fE/QtM9SD4SRYZPwPeUuVbrEGp5HitHg61C/uQxDrJfHOeHLFp+J/cHj4PE2 ChIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=FPSzCF4B4ZUUfFv+NywISnCJ1Cav2tvMYf25Hqqvvgg=; b=b8AOccZFkrNkqkvPCs6RoZkPSQLGDnxFeM2DpEaZXPCom2pdSvfRzOcMymjBfwMixQ RQNLw/bKcT5AtEwAzUezAUiAP9MSAkd+etBtAGnMyaTR08KAN80IxUZmHy0Nn2pi3Ulq 1VLwNu2pBYGpn41PFeN+3Bj2kiXdgbTHmwQaVehCUBMB/PQ7Qi8lCs11SOXL9abhjjCd 9QYTKGkEgeOs0Ex0R6Cqez4+uCfiKs+5bZCQvbi+xJHHscn31s9tloYmqivq3wKIFGlc FhNvdXmmRqhQ1Y1M7Zb23Usao9OiLXRtzTeerY5pi6wGaLUtJgfpbACGujxUoo9xSX3G ktdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Ylw0t/TQ"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a170902ea0500b0017d8a86e524si8267252plg.506.2022.11.22.12.56.00; Tue, 22 Nov 2022 12:56:11 -0800 (PST) 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=@google.com header.s=20210112 header.b="Ylw0t/TQ"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234899AbiKVUjW (ORCPT + 89 others); Tue, 22 Nov 2022 15:39:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234777AbiKVUjN (ORCPT ); Tue, 22 Nov 2022 15:39:13 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5AF868C75 for ; Tue, 22 Nov 2022 12:39:11 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-393c38f7bcfso128045147b3.5 for ; Tue, 22 Nov 2022 12:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FPSzCF4B4ZUUfFv+NywISnCJ1Cav2tvMYf25Hqqvvgg=; b=Ylw0t/TQAkkJ5ZZ1Pjx3hAcFXh/aS80QxJujdVf6jQSIZZqenDDpuUnVzgNX6ILpOT D+OjVdmtDW5/tAPK26Gb1zGy/ZoTCNYUJRF0pyT+nwSM+/hfu38zrqKsPnMqXGmEd+xx cuUwYrnWdEWlYYI+NWRholXeyBpeozHwyScvQAjTUOFxdVVobSIfg3zrrhjVGUP9l7Px HcnmajR3YLpKxiUY3qDInKNDQjuM2qZP0Bd8vfd5A7IwOfoP5RK2bZZ11acFXKOU83kT GwdUHROVxNzf/nQ9nlj5eX8S+GZeK8I5hMFTQ/pyIzMVhZn83FC27sX4jgh9Me5r10Ge mRkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FPSzCF4B4ZUUfFv+NywISnCJ1Cav2tvMYf25Hqqvvgg=; b=hSg9oDOuTDIY7qYkqZIMmukoYNlf5GISiD+Eo0Ml7qK6I4frZ+gk3dB5UWFRXqFhS2 wLVT8pl+UZEaHlELig428vlV/h7/+I57VR5FMA5ZI8Gl0r4X2paNT/Thj9NCDWjTYfkz MFnRfxPMW5Ljzo3VsSZTd3M9qBd+rCXW1kvn0ZmveulmR+DrkoFyQkvt/MUrZbxULF/k V9TRny6uySrE9/yIDcppPpTTvxlgrLl92nwbbyDod163xOVrK75bPJih4nK6Su1T+8/d z2rcKfXmkwnz99TFpM8sr2CLX5FNPKI7pEA47Rkf9V/hSai3OW6+AnFXEqMxxUgBTQBH FUmA== X-Gm-Message-State: ANoB5pnMtnBKeBnTDw5t83zbimYs/3L+zf6iW5RHqONxqtylzbIExPoA TaamPS/HDvUtmBxelO2ajh91Z2O0epb1nIy52Q== X-Received: from almasrymina.svl.corp.google.com ([2620:15c:2d4:203:b7d0:497d:abe4:3e6f]) (user=almasrymina job=sendgmr) by 2002:a25:cccc:0:b0:6de:afe7:1c27 with SMTP id l195-20020a25cccc000000b006deafe71c27mr2ybf.642.1669149550378; Tue, 22 Nov 2022 12:39:10 -0800 (PST) Date: Tue, 22 Nov 2022 12:38:47 -0800 In-Reply-To: <20221122203850.2765015-1-almasrymina@google.com> Mime-Version: 1.0 References: <20221122203850.2765015-1-almasrymina@google.com> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog Message-ID: <20221122203850.2765015-3-almasrymina@google.com> Subject: [RFC PATCH v1 3/4] mm: Fix demotion-only scanning anon pages From: Mina Almasry To: Huang Ying , Yang Shi , Yosry Ahmed , Tim Chen , weixugc@google.com, shakeelb@google.com, gthelen@google.com, fvdl@google.com, Andrew Morton Cc: Mina Almasry , Muchun Song , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 This is likely a missed change from commit a2a36488a61c ("mm/vmscan: Consider anonymous pages without swap"). Current logic is if !may_swap _or_ !can_reclaim_anon_pages() then we don't scan anon memory. This should be an 'and'. We would like to scan anon memory if we may swap or if we can_reclaim_anon_pages(). Fixes: commit a2a36488a61c ("mm/vmscan: Consider anonymous pages without swap") Signed-off-by: Mina Almasry --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 8c1f5416d789..d7e509b3f07f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2931,7 +2931,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, enum lru_list lru; /* If we have no swap space, do not bother scanning anon folios. */ - if (!sc->may_swap || !can_reclaim_anon_pages(memcg, pgdat->node_id, sc)) { + if (!sc->may_swap && !can_reclaim_anon_pages(memcg, pgdat->node_id, sc)) { scan_balance = SCAN_FILE; goto out; } -- 2.38.1.584.g0f3c55d4c2-goog