Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp896845rdf; Tue, 21 Nov 2023 22:47:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyw1H1nF4UG94H71TQ26nX49Z+ReNuqxtX6V+eKn/Bkz4GmHj4ieR12W1uY/6sYtwcfget X-Received: by 2002:a17:90b:3842:b0:280:4c36:5feb with SMTP id nl2-20020a17090b384200b002804c365febmr1609053pjb.17.1700635671933; Tue, 21 Nov 2023 22:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700635671; cv=none; d=google.com; s=arc-20160816; b=AQgpUWHN6j0/d+DwWqiEJ6pXlNUkSJPVUk7xDMD+temlLEqeHpe2oN4MVAzIbS3OBo kOTBvJCUF5iXv8WW3EFMF6nbu3HXVLMFbB3QIoWIm7421dLCYsx2KxTUoLVmKKc4qIxR LVXbYhZvB6JbFE/IEGIMpzeF1O8iDNg7wArHQcCGR4psdhM/u0KyPRfTkE7PGXnxl9Nh fP7sfVQRXC26oayN/BWfVmJdtaTSZ42QtKwjXN+zcoxk/7uhGXT3dEQqWH+M989leEDJ mesf4hkHoeUHFhcsXA6xdISN8n85ImbD/zpLN/n5cvN5i0ItCUCJEwa29HEMUHQqMEB1 H9Ww== 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=5xwyYye+wQlYnjpBJCOKYjPSHv4hsDlpq0YhFNQKNEc=; fh=n4WTBjS1xdw6HwRdJKrn6Pe/bhsoA10ZHXuUQQjAaoM=; b=fAKR2x3JUjOPIw9Qij64GWzSzaK9Ebbib0j7xTFtNwHNKLs9wg4ZrNJXPbt2/vGM8e xYzSWpO85wLVNA/zQUlNm2NH/n7qy8NuARm/evIN2Z7MzrGJmAV7K5BR2orR4EbB7lQ2 YJ60lPnNfqI3pAn4eJaiA51M9BikFKOmAfKBFWf21B2aaZxlYZ+koo4Br0Oeq15A9cqN +MrLQDD8b6zjQDFDm079ZJATQsmLsWQq8FAmvgFkXuAEtFbBRP4Acx6E3j2V5Q9K4JTK Ot9iM38wVmod/8DykR+RKmz69wMQ+e7WKJnTMUH5K/qGofV17x4EQy1+5fgq+Q0CAv5e mrPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2WkCZLXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a24-20020a170902b59800b001b8a8f359fcsi11716241pls.208.2023.11.21.22.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 22:47:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2WkCZLXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 39B3F8077FC3; Tue, 21 Nov 2023 22:45:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbjKVGpR (ORCPT + 99 others); Wed, 22 Nov 2023 01:45:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbjKVGpQ (ORCPT ); Wed, 22 Nov 2023 01:45:16 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B783797 for ; Tue, 21 Nov 2023 22:45:12 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a013d22effcso241321166b.2 for ; Tue, 21 Nov 2023 22:45:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700635511; x=1701240311; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5xwyYye+wQlYnjpBJCOKYjPSHv4hsDlpq0YhFNQKNEc=; b=2WkCZLXzYuuveXZ84dV9zKkCS1FevV3r5g5+QywBiN3I/bEcbwadb4MF46Z/bceZrn 4prNhqCytYXjrrYQhDAfEqmYAi6/9O2sBICAhol+KouaTxcLLynJWVgAiDphxjM4g92U HhWr8pmCAi79QYReu9b36Sf3WFQDY+EfiaOVR1laSIxpkz2XwNdg1nPJ/Jt/MUZPgzvI eZJT3cLHHW/LiXDQK/NGxVAgyLQpjnbjKrCf+5QJLtTEJG+lOSMgNSE+86zpXWeBXnzD GQxNpBNfCBWatUpgzQ6H8Y6S08dR3zAspQeFVOk4w6ivA3VjEZgr5vXUbv45Di+VSVm9 e9XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700635511; x=1701240311; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5xwyYye+wQlYnjpBJCOKYjPSHv4hsDlpq0YhFNQKNEc=; b=RCp1CtrTwhyYq3N3Lyb/97/dYEQzJ+0hQjLiqr3wV2zi5hzd1TCuNavO5OeP4yL//A 8MzEPnH2knBLISb/jJcvEIUVaD0Gb208sRMsAJSBQt0DwN0IEKDzPUVMo4hDm9SKIgst KAIaMjb5wT6/23IvpwWODewc0MqQZQxoUyczwVslJhBoV/4dLw59hIplQBDuGQyDGV3W 3rjLp41HcKtY4jUyYCat+CJffIeCUs7aamQIUarR4Xj9a0dg+g8+Tqy2Mylxd9vrmfhb DOJLxXCe912vdj3VsuKDENjui55jGiG2lKpnzbbseounQ0IwA6L3vZsEFk6tSXwMEUBR LbLw== X-Gm-Message-State: AOJu0YwmAJdfqXvul4KYIUte/e9bQQeGhKytlFVGBX1nCcz4Vs2AK7zI Hr9jmA3EzQwmBixcJCeeezEb31RMayb9pNODY5NkKA== X-Received: by 2002:a17:907:9158:b0:9df:bc50:2513 with SMTP id l24-20020a170907915800b009dfbc502513mr824738ejs.65.1700635510928; Tue, 21 Nov 2023 22:45:10 -0800 (PST) MIME-Version: 1.0 References: <20231121090624.1814733-1-liushixin2@huawei.com> <32fe518a-e962-14ae-badc-719390386db9@huawei.com> In-Reply-To: <32fe518a-e962-14ae-badc-719390386db9@huawei.com> From: Yosry Ahmed Date: Tue, 21 Nov 2023 22:44:32 -0800 Message-ID: Subject: Re: [PATCH v10] mm: vmscan: try to reclaim swapcache pages if no swap space To: Liu Shixin Cc: Michal Hocko , Yu Zhao , Andrew Morton , 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=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 21 Nov 2023 22:45:28 -0800 (PST) On Tue, Nov 21, 2023 at 10:41=E2=80=AFPM Liu Shixin = wrote: > > > 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 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 i= s > > 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= +=3D 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 i= t, is there anything to > pay attention to? I think this might be more intrusive than we think. Every time a page is added to or removed from the swap cache, we will need to move it between LRUs. All pages on the anon LRU will need to go through the file LRU before being reclaimed. I think this might be too big of a change to achieve this patch's goal. > > Thanks, >