Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp894798rdf; Tue, 21 Nov 2023 22:41:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQH57jrzasAV9g+hjQkju72fzWiN4XcL0GCgl/WYaqkKmOJQGQwDyFtNOccJ9sgiXRcR1G X-Received: by 2002:a17:90b:3ec1:b0:283:a71:63be with SMTP id rm1-20020a17090b3ec100b002830a7163bemr1693999pjb.0.1700635303039; Tue, 21 Nov 2023 22:41:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700635303; cv=none; d=google.com; s=arc-20160816; b=xdEXvsK5wDBhC7AJ4dzjnlF2zdiC0t1lD6R1kWU73xCA2Q03sYFuuIdHRacUP6hZoI +Am8Qclld2ZHyATIJ/g95fIIcQgC0MW+eF2mfyhDHE88x8LFCPYV0w99WaINQSgct/6q sbkzBGwjojcx/iBlydQKNbLe2H/ulI5Sr/lMY3oTKQPDGtHTY3PKckiBydXIr+Zgij1B mOVLVX4lsq/EbjgTIYTqHsy1keMGKKuFYRhHf/jaXcmTMyQCHIn/zX+Juo+jXoUNWLYR 1WDZS3ZL8Gi/BCwpaIb5Hs+YmYyYLUZNLjoZZvHEcZ0lRjJmaqk4ri/iPxzrXTmOZ1/j v2tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=c4i1p8hinCnJK5T4OoAuMDz5u42PROz78ljDTW+mOzc=; fh=ar8WQkDKGh7W1IhhI1odvxfThPm/nw+E9/dNAT7Zehg=; b=Bw6Lu2cHkYpQy992HpzZw0XWLFvw+i7SpZxngLIQq59jdCAptScpiZk5MBqxWXcUAK waLb9LazBmP0euHT2GeYmR8OC1XwTptfxTo/6yF8tY/qVcgCCBZ02aEBmVQ0IjjjSJ2c nhHukZqmUGCqoKktaDx/xQpLZcXtwbl8/Ji2bc1Vm7xUnGiQ79r5Za8FAoD7gkTeRt25 EyAMqT1xnoAppFzAKYAdZ/PuBxFEX89FczgPoByVIW3h3gg2gOTohGXFeC5yAGVhxih5 lkuNHuGi9tCodY+TxTJfakb1fVv6xXODHxTQ8BJCHaZ5AkFAn4/2sGJ32SC/3lq9ZJmP VMTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id gq12-20020a17090b104c00b00274df6d4c38si827766pjb.89.2023.11.21.22.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 22:41:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 603008062368; Tue, 21 Nov 2023 22:41:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234799AbjKVGl3 (ORCPT + 99 others); Wed, 22 Nov 2023 01:41:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbjKVGl2 (ORCPT ); Wed, 22 Nov 2023 01:41:28 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5965A97 for ; Tue, 21 Nov 2023 22:41:24 -0800 (PST) Received: from dggpemd200004.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SZs3k4b9CzRjZZ; Wed, 22 Nov 2023 14:37:06 +0800 (CST) Received: from [10.174.179.24] (10.174.179.24) by dggpemd200004.china.huawei.com (7.185.36.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Wed, 22 Nov 2023 14:41:21 +0800 Subject: Re: [PATCH v10] mm: vmscan: try to reclaim swapcache pages if no swap space To: Michal Hocko References: <20231121090624.1814733-1-liushixin2@huawei.com> CC: Yu Zhao , Andrew Morton , Yosry Ahmed , Huang Ying , Sachin Sant , Johannes Weiner , Kefeng Wang , , From: Liu Shixin Message-ID: <32fe518a-e962-14ae-badc-719390386db9@huawei.com> Date: Wed, 22 Nov 2023 14:41:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.24] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemd200004.china.huawei.com (7.185.36.141) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 22:41:40 -0800 (PST) On 2023/11/21 21:00, Michal Hocko wrote: > On Tue 21-11-23 17:06:24, Liu Shixin wrote: > > However, in swapcache_only mode, the scan count still increased when scan > non-swapcache pages because there are large number of non-swapcache pages > and rare swapcache pages in swapcache_only mode, and if the non-swapcache > 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? This paragraph is going to explain why checking swapcache_only after scan += nr_pages; > > 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 > purpose reclaim types. Would it be possible/reasonable to instead put > swapcache pages on the file LRU instead? It looks like a good idea, but I'm not sure if it's possible. I can try it, is there anything to pay attention to? Thanks,