From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1046BC072A2 for ; Wed, 22 Nov 2023 06:41:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234831AbjKVGla (ORCPT ); Wed, 22 Nov 2023 01:41:30 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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,