Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp499472rdh; Thu, 23 Nov 2023 09:31:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBVTB4Mo1Lw/TSxzGM+lyJ93Y47k+5NiHzHq8DA5DqPlyg4T2a3Oq7Q9mvtGbJ9/5ua3tv X-Received: by 2002:a17:90a:684e:b0:280:22e2:60ea with SMTP id e14-20020a17090a684e00b0028022e260eamr154767pjm.3.1700760667284; Thu, 23 Nov 2023 09:31:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700760667; cv=none; d=google.com; s=arc-20160816; b=bIAyJR3bvcBrINcuGnfOq77dFoj81U9bkOwz/0tTdHQ3Gw2XfhPklIwvqtc7THDz/Z sYsvXWafs57fw9viXlmGZ+6BoeknAFotznEy5GBsMBA2B8P4JXRbOceO5sNaNW/MjPfU GzB8mZpX97zZw6WCL6PfACOLJ80ckvttotinH4KK39LHZCCAITZFma+/lnpW7xQXnKS4 RdEi3pcW3yoGhRdIMbMspJ8Gk9tbnxpenKvXWyayNC+HJrs/RoHnH+aAA1epZo5Y6kQD 4fTQT/MPBM808qIlNEswWfcTmyH9ME70M+spGEiI49lKRWf+3/qBJSWiC6sVruT3nf4p RlqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GcOst3/22+6cuv9lswU+ry4+GdAAZVPRN7gJdD9N6n4=; fh=zwgj4nKv6ngZrKkSbjNCDOixD/nNdZxp8qR33nxljEI=; b=UI3Kvidi785l49OVWNI7jOoIlzu/uQgIfojpMlO/DlZ5gdfeqtJR6PO9Y/DhpqDFQ0 bbNA2gWDUlYMrSxpL90wTtQmGI05/DHvqCFqnwwn7RUIfdMBolSJtlZaHyZdSedhs+zC ACUBVbzDY0dc7nlJYsdNNqGAJvkLQmqW0ZEBvZ4QaLlpdN8d1VzERfzb55sGRkP3dmo0 vnV0PnMTEcFxlVABh5TO++/lZXVceytnCkeGSsRJdRW4ZW1NnRrmfAAJXE7wKF37dPSm 0BIE49CiPo8jDuntuRBh75qoRYIgeKtjCVrv66drDYP7CHyp6+4aAQRFFHj0q/gP77+7 1nag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Qz7mod4/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bj12-20020a17090b088c00b002803c4a0684si1655988pjb.189.2023.11.23.09.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 09:31:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Qz7mod4/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6E4B08069D42; Thu, 23 Nov 2023 09:31:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbjKWRaq (ORCPT + 99 others); Thu, 23 Nov 2023 12:30:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbjKWRae (ORCPT ); Thu, 23 Nov 2023 12:30:34 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A52E71710 for ; Thu, 23 Nov 2023 09:30:35 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41090C433BB for ; Thu, 23 Nov 2023 17:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700760635; bh=GcOst3/22+6cuv9lswU+ry4+GdAAZVPRN7gJdD9N6n4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Qz7mod4/HwaHJK0JAB3ytD3MH8bBSYf8iVVbxyfCL1i/Zs6EaxhyzZ0+HRfgGgLRE 7KYF+Vw44ia7HO0mtZe6yNWu2wGG5dX7LTzWtPvh5MEXCxFa2Opa4yGNWXBwiqumzT OQoZP7jTRMTNAN9wgg0KoDA+vKwqyQPTwQy/IXCqlURybqriy7jxNCQRmvtEEdhBEp 9Xj0bqmhY869YhySGf3rjhIWMZSOwhzaFPKHnbgQXjg1zVoB8XolM9ff6mKYt0gLHq xg18bmw/eeDCgNR1WtWJ8g7EWNw/CAxaofPrCUhSgPJqL78JV0q0plchZ5E05HZRz6 e2oH4RK5uPd8w== Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2809b4d648bso914961a91.2 for ; Thu, 23 Nov 2023 09:30:35 -0800 (PST) X-Gm-Message-State: AOJu0YxMSdDYBW3XW0AHr6rh+V41/Qc2VDbjs39hnkJjcdb1YhrqdCRn LU2KSCFvJ/j7lkWs7nBD8A5GGISjp6KswA95wR14pw== X-Received: by 2002:a17:90b:1001:b0:285:6f1a:4a71 with SMTP id gm1-20020a17090b100100b002856f1a4a71mr149425pjb.32.1700760634650; Thu, 23 Nov 2023 09:30:34 -0800 (PST) MIME-Version: 1.0 References: <20231121090624.1814733-1-liushixin2@huawei.com> In-Reply-To: From: Chris Li Date: Thu, 23 Nov 2023 09:30:23 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v10] mm: vmscan: try to reclaim swapcache pages if no swap space To: Michal Hocko Cc: Liu Shixin , Yu Zhao , Andrew Morton , Yosry Ahmed , Huang Ying , Sachin Sant , Johannes Weiner , Kefeng Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 23 Nov 2023 09:31:04 -0800 (PST) On Tue, Nov 21, 2023 at 5:00=E2=80=AFAM Michal Hocko wrot= e: > > However, in swapcache_only mode, the scan count still increased when sc= an > > non-swapcache pages because there are large number of non-swapcache pag= es > > and rare swapcache pages in swapcache_only mode, and if the non-swapcac= he > > is skipped and do not count, the scan of pages in isolate_lru_folios() = can > > eventually lead to hung task, just as Sachin reported [2]. > > I find this paragraph really confusing! I guess what you meant to say is > that a real swapcache_only is problematic because it can end up not > making any progress, correct? > > AFAIU you have addressed that problem by making swapcache_only anon LRU > specific, right? That would be certainly more robust as you can still > reclaim from file LRUs. I cannot say I like that because swapcache_only > is a bit confusing and I do not think we want to grow more special That is my feeling as well. I don't like to have too many special purposes modes either. It makes the whole process much harder to reason. The comment seems to suggest it is not effective in some situations. I am wondering if we can address that situation more directly without the special mode. At the same time I am not very familiar with the reclaim code path yet. I need to learn more about this problem space to articulate my thoughts better . I can dig in more, I might ask a lot of silly questions. Chris > purpose reclaim types. Would it be possible/reasonable to instead put > swapcache pages on the file LRU instead? > -- > Michal Hocko > SUSE Labs >