Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2851228rdh; Sun, 26 Nov 2023 23:42:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSc7zjr9dnrtE68MhV/5si3p00426mEzII+uGY7EyWEXyYHYMP/ruzoTXjnp19QfANQLzp X-Received: by 2002:a05:6a20:729c:b0:18c:7b7:8630 with SMTP id o28-20020a056a20729c00b0018c07b78630mr8729193pzk.13.1701070959324; Sun, 26 Nov 2023 23:42:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701070959; cv=none; d=google.com; s=arc-20160816; b=05TeMh+E5KzVCfJheQuyukeXTDd7AbUio8+b1o29hDYQPcWFwJOwq/W1k1IVCnrjdD rLg+P4MB/oKVkQWH7GnzWvx8YxoBapGvZhGFSaj/p09/x5HXqmzTF63OkgidIzwFjVDO CEztnJaz9ybtoJq85I2Ql1XrLTQrsisoG9xprGTsZVliN7Eamw3VCPE5/FDEXGo3MF9X 46EY2Ck0msvzuHffBTMCI5jYMxc+mY+7xRqahSjmp65vhWhlPb+cuHIIsltnEpOW6xUq 9xklm3XYJNCC1bKeBi6zpj73vXWHjXLxiI8GpOhxK/j9lScfAU6ewOlLp61ajgqlAQ1D 7e3w== 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=rROM1MAuP2epaHhX6fHHDfXixafW+fcvrWkBOWzK1wc=; fh=Q3in+Zj8i+1u355xA8WE5smC8DoifKbEIbbGcrph4G0=; b=daYGHN7MDEOEl58JlDxKTvpoYJX/WJrqkoXgW5tsci02fQ4QQSHstHcRyK7ExXga5X 4yjGUAlWbHX7Ohu2D1Nf2bDyfsSyHq3+bVSCqNRIzdkbH76PK/70htv2mCGHtaUVRiVP owA+o0cpRn+m036FAOl5Rtjk+YMB0ZDoual/W8AJ4ppPwWZa2w4bMdVnMp6zDUsB6ULF cNBDPj4EBdp4S/P23BgTSVgzYZOKFhBXXYDpdHenzI6HiNRlzWrE73CoX+a6+u0hAtza RqWBtJBK3x0x4DBwk9xFjG4B98YEDrrg+2KIDKG9J492Rd8m+7j36su3QwPP2VAdbmxY E91A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HnwmaykA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id y3-20020a056a00180300b006cd92bdabfdsi892542pfa.48.2023.11.26.23.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 23:42:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HnwmaykA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 96196808EDED; Sun, 26 Nov 2023 23:42:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbjK0HmT (ORCPT + 99 others); Mon, 27 Nov 2023 02:42:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjK0HmR (ORCPT ); Mon, 27 Nov 2023 02:42:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8E9C12F for ; Sun, 26 Nov 2023 23:42:23 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EA9AC433CB for ; Mon, 27 Nov 2023 07:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701070943; bh=8FsHT2Xzon2e0xd3rsRca6eGh3KS8yCnz1RZFCNvPxY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HnwmaykAFhH00oP/GM9Lhke7OaPq5UUVWk9tlQwSfzs+nHHyRtlfrXjSQv9uYGwuh eb3VPBICH22rStDvM35PrzQbCR8/iraKKRkd9sJd1NGxFal+cOtLfN+b+j2WvEEwtA asuaysndIrxQXXz4DNqydexnUKEOkwnrhQJZWajm8dca0o6WCL/bmsKTa0Fs+gLXCW 6hTAkCE5BIi66HIeyGjXirTVBy+QXd3ttn/Lybb+mN34XcbzA+fLLgk115J1VYL3lw ECAvE793NRSTl2ba4zG9UfVciI82s5P9Y9PrKTwIArS6h23S8Ff/R8fZiYs9DNBg+M eXBqQApnNMqgw== Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-285d32c6f07so378009a91.1 for ; Sun, 26 Nov 2023 23:42:23 -0800 (PST) X-Gm-Message-State: AOJu0YyEYt5c+Xyl4Vn2fEbdhu0JB0THeervmfm+wlvOEjukOE1Lj7EO 8P4eSNWDEjGwNxGo+fvcUWRsQBuvBHhBW+V19H8EAA== X-Received: by 2002:a17:90a:1a03:b0:280:2652:d4e with SMTP id 3-20020a17090a1a0300b0028026520d4emr9440658pjk.29.1701070942704; Sun, 26 Nov 2023 23:42:22 -0800 (PST) MIME-Version: 1.0 References: <20231121090624.1814733-1-liushixin2@huawei.com> <32fe518a-e962-14ae-badc-719390386db9@huawei.com> <87msv58068.fsf@yhuang6-desk2.ccr.corp.intel.com> <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> In-Reply-To: <87h6l77wl5.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Chris Li Date: Sun, 26 Nov 2023 23:42:11 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v10] mm: vmscan: try to reclaim swapcache pages if no swap space To: "Huang, Ying" Cc: Michal Hocko , Yosry Ahmed , Liu Shixin , Yu Zhao , Andrew Morton , 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.2 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 fry.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 (fry.vger.email [0.0.0.0]); Sun, 26 Nov 2023 23:42:36 -0800 (PST) Hi Ying, On Sun, Nov 26, 2023 at 6:36=E2=80=AFPM Huang, Ying = wrote: > > Michal Hocko writes: > > > On Thu 23-11-23 14:15:59, Huang, Ying wrote: > >> Michal Hocko writes: > > [...] > >> > Yes swapcache pages are indeed more complicated but most of the time > >> > they just go away as well, no? > >> > >> When we swapin a page, we will put it in swapcache too. And the page > >> can be in that state for long time if there is more than 50% free spac= e > >> in the swap device. > > > > True, but why is that a problem? If you encounter such a swapped in pag= e > > on the file LRU then the page should be referened and as such should be > > activated, no? > > This just means that anonymous pages in file LRU aren't temporary or > short-term. So we need to consider that. For example, the original > method to balance between anonymous pages and file pages need to be > re-designed. The anonymous pages are considered hotter than file pages > in general. I agree with Ying that anonymous pages typically have different page access patterns than file pages, so we might want to treat them differently to reclaim them effectively. One random idea: How about we put the anonymous page in a swap cache in a different LRU than the rest of the anonymous pages. Then shrinking against those pages in the swap cache would be more effective.Instead of having [anon, file] LRU, now we have [anon not in swap cache, anon in swap cache, file] LRU Chris